So… you accidentally formatted your SSD. Yup, been there. Whether you clicked the wrong button or tried to reinstall Windows/macOS and wiped the wrong drive—don’t panic just yet. In many cases, your files are still recoverable.
In this post, I’ll walk you through a few free and command-line-friendly ways to recover files from a formatted SSD. No paid software. No fake “free scan, pay to recover” tricks. Just straight-up methods that might actually work.
Quick Heads-Up
Before we dive in, a few things you should keep in mind:
-
Stop using the SSD immediately after formatting. Don’t save anything else to it.
-
Recovery success depends on how the drive was formatted (quick vs full), and how much it’s been used afterward.
-
SSDs with TRIM enabled (which is usually the case) are trickier—but still worth trying.
✅ Method 1: Try TestDisk (Totally Free & Command-Line Based)
This one’s a classic.
TestDisk is an open-source data recovery tool that works on Windows, macOS, and Linux. It runs in the terminal, so no bloated GUI nonsense. And yes, it’s completely free.
🔧 Steps:
-
Download TestDisk from the official site:
👉 https://www.cgsecurity.org/wiki/TestDisk_Download -
Run it as administrator (on Windows) or use
sudo
(on Mac/Linux). -
In the terminal, navigate to the extracted TestDisk folder and type:
-
Choose the formatted SSD from the list.
-
Select
Intel
or appropriate partition type (usually auto-detected). -
Choose
[Analyse]
, then[Quick Search]
to detect lost partitions. -
If partitions are found, press
P
to list files. You can now copy files to another disk!
It may look a little retro, but it works surprisingly well—especially for partitions lost due to accidental formatting.
✅ Method 2: PhotoRec (by the same folks, for file-level recovery)
PhotoRec is TestDisk’s sidekick. It doesn’t care about partitions—it just scans your drive sector by sector looking for file signatures. Great if your partitions are toast but you need photos, docs, or videos.
How to use it:
-
It comes bundled with TestDisk, so no extra download needed.
-
In the terminal, run:
-
Select your SSD, then choose the partition type.
-
Choose the file system (usually “Other” for non-ext2/ext3).
-
Set output directory (ideally on another drive), and go!
Heads-up: It may dump thousands of files with generic names, but hey—some recovery is better than none, right?
🧪 Bonus (For Linux Geeks): grep
raw drive sectors
If you’re on Linux and feeling a little daring, you can literally use grep
to scan raw sectors for strings or file headers:
Not for the faint-hearted, but surprisingly effective if you know what you’re looking for.
Why Windows File Recovery Tool Kinda Sucks
Microsoft has a command-line tool called winfr
(Windows File Recovery). It’s available from the Microsoft Store, but it’s… meh. Works best on NTFS, struggles with SSDs, and feels a bit clunky. Still, worth trying if you’re desperate and don’t want third-party tools:
Final Thoughts
If your SSD has TRIM enabled (most modern ones do), full recovery might not always work. TRIM actively clears unused blocks, making file recovery much harder. But with tools like TestDisk or PhotoRec, you still have a fighting chance.
Best part? It’s all free, open-source, and no gimmicks.
TL;DR
-
Use TestDisk for partition recovery
-
Use PhotoRec for individual file recovery
-
Stop writing anything new to the SSD
-
Hope TRIM hasn’t wiped everything 😬
Good luck! And next time… maybe double-check before formatting