When a file is deleted the area is marked as free space, if the area hasn’t been used you can recover the data. Raw data recovery applications like PhotoRec are able to rebuild files in the free space area.
Step 1: Download the latest stable release of TestDisk & PhotoRec.
Step 2: Extract the files and run photorec_win while the USB drive is connected to the computer.
Step 3: Use the Up/Down arrows to select the USB Flash Drive (usually /dev/sdb) and press Enter.
Step 4: Choose Intel
Step 5 (optional): If you only wish to recover specific file types such as pictures select File Opt, press s and select the desired file types by pressing the space bar. For example “JPG Picture” or “GIF Graphic Interchange Format”
Step 7: Choose Other and if asked choose Free.
Step 8: Press Y to save the recovered in a subfolder
Step 9: Open up the recup_dir.xxx folder in the PhotoRec directory. Any recovered data will be saved there. Recovered files won’t have their filename because photorec ignores the file system. If you’re recovering pictures you can locate the file by using thumbnail mode in the folder.