If you immediately realise you accidently deleted something, then go to the edit tab and click on 'undo'. I am not sure what you can do if you deleted an entire fine though.
If you have pressed delete on a file by accident the file should be within your recycle bin, if you pressed the shift key when deleting then the file is lost. Although there are pieces of software that can retrieve files that have been deleted and removed from your recycle bin, Look on www.zdnet.com and search for undelete this will bring up several packages which can be downloaded on a trial period or are free to use as long as you follow the licence agreement.