Undelete Files Using Terminal in Mac OS X

If you have ever deleted a file accidentally you will know just how frustrating it can be.

There are many products out there that can help you undelete a file however before you go out and buy one of them its worth trying this simple method using a Terminal command.

Terminal icon in dock

Afraid of using Terminal? well don’t be, as long as you carefully follow these instructions with care there is no danger of your Mac exploding.

1 – Open Terminal – find it by typing Terminal in Spotlight or navigation in the Finder to Applications / Utilities / Terminal

2 – In the Terminal window type: cd .Trash then press the enter key.

3 – Type the full name of the file you are looking to restore in this format:mv filename ../
(replacing filename with the name of your file) press the enter key.

4 – Press the CMD and F key at the same time to open a Finder window. Type the name of your file into the search box and hit the enter key.

5 – With luck your undeleted file will appear in the list below, either open the file by double clicking to re-save or drag it onto your desktop.