DEV Community

Miftahul Rizki
Miftahul Rizki

Posted on Originally published at miftahulrizki.eu.org

How to Recover Deleted Files from a USB Flash Drive (Tested: 100% Recovery)

Deleted a file from your USB flash drive? Unlike your PC's hard drive, it doesn't go to the Recycle Bin — it vanishes from the listing instantly. But here's the good news: in most cases it's still recoverable, and I proved it with a real test.

Why deleted files can come back

When you delete a file on a FAT32/exFAT flash drive, the OS doesn't erase the data. It only marks the directory entry as deleted (hex code 0xE5) and frees the clusters in the FAT table. The actual data sits there untouched — until something new overwrites it.

That gives us three golden rules:

  1. Stop using the flash drive immediately.
  2. Install recovery software on your PC (drive C:), never on the flash drive itself.
  3. Save recovered files to a different drive.

I tested it myself

I created a 64 MB FAT32 disk image as a stand-in flash drive, filled it with 3 files, then deleted 2 of them. The file listing was empty — but the data was still intact inside the raw disk. PhotoRec (free, open source) recovered both files with byte-identical md5 checksums. 100% recovery.

Then I ran the scarier test: I overwrote the freed clusters with random data, simulating a drive that kept being used after the deletion. Result: zero. Not a single file came back. The "stop using it" rule isn't a myth — it's physics.

Best free tools (2026)

  • Recuva (Windows) — free with no capacity limit, beginner-friendly wizard. Install on C:, select the flash drive, enable Deep Scan, recover to another drive.
  • PhotoRec (Windows/Mac/Linux) — free and open source, no limits, 480+ file types. Command-line only, no preview, recovered files get generic names.
  • Windows File Recovery (winfr) — Microsoft's free official tool, command-line only.
  • EaseUS Data Recovery — free tier 500 MB (up to 2 GB via the share button), nice file previews.
  • Disk Drill — free tier 500 MB.
  • DMDE — free edition recovers 4,000 files per operation.

One myth to kill: the attrib command

You'll see attrib -h -r -s /s /d G:\*.* recommended as "recover without software." It only reveals files hidden by viruses — it cannot recover actually deleted files. Useful, but for a different problem.

When to call a professional

If the drive isn't detected at all, shows 0 MB, or keeps asking to be formatted, stop scanning and take it to a data recovery service. Repeated scans on dying hardware make things worse.

I published a full 7-method walkthrough with terminal screenshots (in Indonesian) on my blog: https://www.miftahulrizki.eu.org/2026/10/cara-mengembalikan-file-yang-terhapus.html — it goes deeper, including Android-specific options and a prevention checklist. If this post saved your files, the full guide is worth a read.

Top comments (0)