If you’ve accidentally deleted a file, formatted a disk or your hard drive crashed, you may think your files are gone forever. PhotoRec is a free application that searches your media (hard drive, SD card, CD, USB drive, etc.) for any recoverable files. It searches for numerous file types including photos, video, audio and documents. As long as you can still connect the media to a working computer, you can use PhotoRec.
When files are deleted, they are still stored on your hard drive or other media. They aren’t completely removed until another file is written over them. The moment you realize a file is missing, you should stop using the drive to increase your chances of recovering your files. PhotoRec even uses read-only access when scanning for files and stores recovered files to a different location.
Connect the media you want to recover files from now. This must be connected before starting PhotoRec.
Download the latest version of PhotoRec  for your operating system. Do not download the Beta versions. Please note that PhotoRec is bundled with TestDisk which can used to analyze disk partitions. You won’t need to use this software for recovery, but the two programs will download together.
You don’t need to install anything. Locate the downloaded file, which will say testdisk-version, and extract the files. For Windows, right-click the zipped file and choose Extract All.
Accept the default settings and press Extract. A new folder is created with the same name. Open this folder to access PhotoRec.
Double-click photorec_win to open the program. If you don’t use Windows, win will be an abbreviation for your operating system. PhotoRec is compatible with Windows, Linux, Mac and DOS.
Press Run to launch the program.
PhotoRec is DOS based and requires you to use your keyboard to input commands. It does not work with a mouse or other input devices.
Use your up/down arrow keys to select the media or drive you want to recover files from. When the correct media is highlighted, use your left/right arrow keys to select Proceed and press Enter on your keyboard.
Use your up/down arrow keys to select the partition you want to recover files from. If you only have one partition, it will already be highlighted. If you’re uncertain which partition to select, choose the partition titled Whole Disk. Partition names are listed to the far right of each partition.
Use your left/right arrow keys to highlight Options at the bottom of the PhotoRec window. Press Enter on your keyboard to view available file search options.
Use your up/down arrows to select different options. Use your left/right arrows to scroll through each setting for individual options. If you are trying to recover photos, especially JPEG files, select Paranoid and choose Yes <Brute force enabled> as your search option. Select Quit when you’re finished and press Enter to return to the previous screen.
Use your left/right arrows to select Search and press Enter.
Choose the file system your media uses. Linux systems typically use ext systems while Windows systems, SD cards and USB drives use FAT and NTFS. Press Enter to continue.
Use your up/down arrows to choose a location to store the recovered files. Use your left/right arrows to choose a new directory. By default, PhotoRec creates a folder inside the extracted folder that the PhotoRec program is stored in. In most cases, this is acceptable. Never store recovered files on the same media or partition that you’re trying to recover from. For instance, if you’re recovering files from a USB drive, store the files on your computer instead of the USB drive.
If you’re happy with the default location or after you’ve chosen a new location, press C to continue.
When the scan is finished, you’ll see a results screen with the number of files recovered along with the directory they’re stored in. This may take several minutes to over an hour depending on the size of the media you’re recovering from. Select Quit and press Enter to exit the program.
Open your destination folder to view your recovered files. The folder is typically named recup_dir.1. If you perform multiple recoveries to the same directory, the folders are named with increasing numbers, such as recup_dir.2.
Your files will not have their original names. You will need to go through the files to determine what you want to keep. To make it easier, sort files by file type.