Command for restore selection

Say for e.g i have selected some files and by mistake clicked some where else then the selection is lost,how to restore selection

There isn't a way to do that.

Edit > Select Other > Reselect Files can restore the selection from before the previous command was run, but it doesn't do anything if you deselected everything by clicking the background.

Power Mode in Opus lets you have other selection styles where it is harder to deselect everything by accident. That might be worth investigating if you find you are accidentally clicking to deselect everything a lot.

There's also checkbox mode, which means you have to actually click the checkbox to turn a file's selection on or off, and clicking the background does nothing.

If you know you are about to make click-mistakes, or doing some things which might render your selection useless, you can save the current selection with the SelectEx script addin. You can find it here in the forum script addin section.

After i install the script how to use it for what i have asked in the first post

Please read my post again, SelectEx won't help you, if you don't take precautions with the help of SelectEx beforehand. You can save the current selection to clipboard or DO internal variables, files etc.. and these selections can then be restored. Consider to download/install the provided SelectEx menu button, which exposes some of the functionality of SelectEx (including saving/restoring selections).