Few moments are as stressful as realizing you’ve just deleted or formatted the wrong drive. Maybe it was a collection of precious photos, important project documents, or your favorite videos — and suddenly, it’s all gone.
Before you panic, there’s good news: your data isn’t necessarily lost forever. Even if you formatted a drive or emptied the Recycle Bin, there’s a high chance that your files are still recoverable — as long as you stop using that drive immediately and use the right recovery tool.
In this detailed guide, we’ll walk through how to recover deleted, formatted, or lost files and even full partitions on Windows using a free and open-source tool called TestDisk & PhotoRec. You don’t need any paid software or subscription — this method works completely offline and is trusted by professionals worldwide.

💡 1. Understanding How Data Recovery Works
When you delete a file or format a drive, the data isn’t actually “erased” right away.
Instead, the system simply marks that space as empty, allowing new data to overwrite it later.
Until that happens, the deleted files can still be recovered by scanning the drive’s sectors — and that’s exactly what data recovery tools like PhotoRec do.
However, if you keep saving new data to the same drive, the deleted files might get overwritten, making recovery impossible.
That’s why the first and most important rule is:
Stop using the drive as soon as you realize files are missing.
🧰 2. What Are TestDisk and PhotoRec?
TestDisk and PhotoRec are two powerful, open-source data recovery utilities developed by CGSecurity.
- TestDisk is primarily designed to recover lost partitions and fix boot issues.
- PhotoRec, on the other hand, focuses on recovering individual files — documents, photos, videos, and archives — from formatted or corrupted drives.
They both run directly without installation, support multiple file systems (NTFS, FAT, exFAT, ext2/3/4, HFS+), and work across Windows, macOS, and Linux.
👉 Official Website: https://www.cgsecurity.org/wiki/TestDisk_Download
🧾 3. When Should You Use This Tool?
Here are common situations where TestDisk or PhotoRec can help:
- Accidentally deleted important files (Shift + Delete or emptied Recycle Bin)
- Formatted the wrong partition or USB drive
- Lost partitions due to disk errors or corruption
- External drive showing “RAW” or not accessible
- SD card or pen drive not readable but visible in Disk Management
If your drive is physically damaged (e.g., clicking sounds), this tool won’t help — in that case, you’ll need professional hardware recovery services.
⚠️ 4. Step 1 – Stop Using the Affected Drive
Before you do anything else, stop writing or copying any new files to the drive that lost data.
Every new file increases the risk of overwriting old data blocks, making them unrecoverable.
If it’s your system drive (C:), you can use an external USB or another PC to perform recovery safely.
So far, so good — now let’s move to the next step and grab the recovery software.
⬇️ 5. Step 2 – Download TestDisk & PhotoRec
Go to the official CGSecurity website and download the latest version:
👉 Download TestDisk & PhotoRec
You’ll see different versions for Windows, macOS, and Linux.
If you’re on Windows 10 or 11 (64-bit), choose the top option labeled:
“TestDisk & PhotoRec 7.x for Windows 64-bit”
The file size is small (around 29 MB), so it should download within a minute.
Once downloaded:
- Locate the ZIP file in your Downloads folder.
- Right-click → Extract All → Choose a location and click Extract.
- You’ll get a new folder named something like
testdisk-7.x-win.
Inside, you’ll find several files — including one called photorec_win.exe.
That’s the program we’ll use for recovering files.
🖥️ 6. Step 3 – Extract and Open PhotoRec
Now that the files are ready, open the extracted folder. Scroll down until you see:
photorec_win.exe
Right-click on it → select Run as Administrator.
If Windows shows a security prompt (“Windows protected your PC”), click More Info → Run Anyway → Yes.
A black command window will open — this is PhotoRec’s main interface.
Although it looks text-based, don’t worry — it’s straightforward and easy to navigate with your arrow keys and Enter.
💽 7. Step 4 – Identify the Correct Drive
PhotoRec will now display a list of all the storage devices connected to your system.
Use the arrow keys to navigate and select the drive you want to recover from.
Here’s how to identify the correct one:
- Look at the drive size — for example, 64GB might be your pen drive, while 500GB could be your hard disk.
- Cross-check with File Explorer → This PC, right-click on the drive → Properties → confirm its capacity.
Once identified, select the correct drive and press Enter.
💡 Example: If you formatted your 64GB USB pen drive, choose the drive that matches that size.
🗂️ 8. Step 5 – Choose What to Recover
After selecting the drive, PhotoRec will ask:
“Do you want to recover from the whole disk or a specific partition?”
If you’re unsure, it’s usually best to choose “Whole Disk” to ensure nothing is missed.
Use the arrow keys to select [Whole Disk] and hit Enter.
This tells PhotoRec to scan all available partitions for recoverable files — even those that were formatted or deleted.
🧾 9. Step 6 – Select the File System Type
Next, PhotoRec will ask about the file system of the lost partition — this helps it understand how to interpret deleted data.
If you’re recovering from a typical Windows drive or USB, the file system is likely NTFS or FAT32.
So, choose the second option: “Other”, which covers both FAT and NTFS file systems, and press Enter.
If you’re unsure, you can always check:
- Open File Explorer
- Right-click on your drive → Properties → under “File System,” note whether it’s NTFS or FAT32.
📁 10. Step 7 – Choose a Safe Recovery Destination
PhotoRec will now ask where you want to save the recovered files.
This part is critical — you should never recover files to the same drive you’re recovering from. Doing so may overwrite the data you’re trying to restore.
Let’s say your formatted USB is Drive D: — then choose another location like your E: or F: drive, or even your system drive (C:) if it has enough space.
Here’s how:
- In the PhotoRec window, use the Left Arrow key to go back to the root directory (C:).
- Navigate to another drive (E: or F:) and press Enter.
- Once there, you can even create a new folder (e.g., “Recovered Data”) using File Explorer.
- Return to PhotoRec, select that folder, and hit Enter.
When the correct folder is selected, press the C key to confirm.
⚙️ 11. Step 8 – Start the Recovery Process
As soon as you press C, the recovery process begins.
PhotoRec will start scanning the drive sector by sector, searching for lost files.
You’ll see progress details in the command window, including:
- Number of files recovered
- Time elapsed
- Estimated time remaining
Depending on your drive’s size and data amount, this may take a few minutes to several hours.
Be patient — let it complete fully without interrupting.
During recovery, PhotoRec automatically categorizes files (photos, videos, documents, etc.) into folders inside your chosen destination directory.
✅ 12. Step 9 – Check and Restore Your Files
Once the process is complete, you’ll see a summary showing how many files were recovered.
Now, open the destination folder you selected earlier (for example, “E:\Recovered Data”).
Inside, you’ll find subfolders like:
recup_dir.1
recup_dir.2
recup_dir.3
Each folder contains recovered files sorted by type.
Open them, and you’ll start seeing your old photos, videos, or documents — just like before!
You can preview the files to verify that they work.
Then, copy them back to their original drive (after formatting it freshly) if needed.
🎉 Congratulations — you’ve just successfully recovered your lost or formatted files for free!
🧠 13. Tips to Improve Recovery Success Rate
Data recovery can be unpredictable, but following these best practices can dramatically improve your chances:
- Act immediately: The sooner you run PhotoRec after data loss, the higher your success rate.
- Avoid writing new files: Don’t download, copy, or install anything to the affected drive.
- Use a different destination drive: Always save recovered files somewhere else.
- Be patient: Large drives with many files take time — don’t close PhotoRec mid-process.
- Check all recovered folders: Sometimes, files may appear in later directories.
💬 14. Frequently Asked Questions (FAQ)
Q1. Can this recover files from a formatted USB or SD card?
Yes. PhotoRec works perfectly for USB drives, SD cards, external drives, and even hard disks.
Q2. Does it restore file names and folder structure?
Not always. PhotoRec focuses on recovering file content. It may rename them automatically (like f12345.jpg), but the data inside remains intact.
Q3. Can it recover videos, PDFs, or ZIP files?
Absolutely. It supports over 480 file formats — including MP4, AVI, DOCX, PDF, JPG, PNG, and ZIP.
Q4. Is it completely free and safe?
Yes. Both TestDisk and PhotoRec are open-source and have been trusted for over a decade.
No ads, no malware, and no paid version.
Q5. Can it fix damaged partitions too?
Yes. If your partition itself is lost, you can use the TestDisk utility (included in the same download) to rebuild it before running PhotoRec.
Q6. What if the recovery fails?
If files appear corrupted, try rerunning PhotoRec using the “Free” (unallocated) option instead of “Whole Disk.” If still unsuccessful, the data may have been overwritten.
🧾 15. Final Thoughts & Disclaimer
Accidental deletions or formatting mistakes can happen to anyone — but with the right tools, they don’t have to be permanent.
TestDisk & PhotoRec are proof that open-source software can outperform many commercial data recovery programs.
They’re small, powerful, and effective — capable of recovering everything from simple text files to complex videos.
However, remember that no recovery is guaranteed once data has been overwritten. Always make regular backups and avoid saving new data on the affected drive until recovery is done.
If you follow this guide carefully, there’s a 95–99% chance you’ll get your files back safely.
Official Website: https://www.cgsecurity.org/wiki/TestDisk_Download
#DataRecovery #PhotoRec #TestDisk #Windows11 #USBRecovery #OpenSourceTools #FileRecovery