If you have accidentally deleted an important file or document from your Mac, there are several methods you can use to recover your deleted files.
How To Recover Deleted Files
Restoring Files from the Trash Folder
This will perhaps sound obvious, but you should always check if the file or document is still in the trash folder. If you have not yet cleared the latter, you may still be able to recover your files. Open the trash folder, if you find the file you are looking for, you can restore it using one of the below methods:
Drag the file to the desktop
Right-click on the file > restore
Restore from Time Machine Backups
Time Machine is a tool to backup and restore your files or configuration as they were at a certain point in time. This also include deleted files.
Open the folder in which the original file was (before you delete it). If your Time Machine backups on an external hard drive, connect the later and launch Time Machine.
Navigate through your backup files or use the search menu to find the deleted file.
From there you can restore the file
Use a program to recover your data
NB: Not all of your deleted files can be restored.
First of all, stop using your hard drive to prevent your deleted file (if there is still a trace) from being overwritten. Do not open any program, do not save anything, do not create anything and do not delete any more files!
If the file you have deleted is on your boot drive, turn off your Mac.
Download a data recovery program (from another computer if possible)
You can use one of these programs: