Recover deleted files and photos from any disk.
GitHub RepoImpressions752

Recover deleted files and photos from any disk.

@githubprojectsPost Author

Project Description

View on GitHub

Got That Sinking Feeling? How to Rescue Deleted Files with TestDisk

We've all been there. That moment of cold dread when you realize you just deleted the wrong folder, emptied the recycle bin, or formatted a drive with precious photos still on it. For most users, that's the end of the story. But for developers and tinkerers, there's often a lifeline: data recovery tools. Today, we're looking at one of the most powerful and respected open-source tools in this space—TestDisk.

It's not a shiny, one-click GUI app. It's a robust, command-line warrior that digs deep into disks to recover lost partitions and undelete files. If you've ever needed to salvage something from a digital oops moment, this project is worth knowing about.

What It Does

TestDisk is a free, open-source data recovery utility. Its primary mission is to help you recover lost partitions and make non-booting disks bootable again. A companion program, PhotoRec, is specifically designed to recover files—including photos, documents, and archives—from hard disks, CD-ROMs, and other storage media, by ignoring the file system and going after the raw data.

Think of it as a digital archaeologist. It scans your storage device sector by sector, looking for the signatures of known file types and partition structures that your operating system can no longer see.

Why It's Cool

The cool factor here is all about power and principle. TestDisk is effective because it works at a low level. When a file is "deleted," the data often remains on the disk until it's overwritten; the system just marks the space as available. PhotoRec exploits this by doing a deep, file-agnostic scan, carving out files based on their headers and footers.

It supports a massive list of file formats (over 480 for photos and videos alone), works on a ton of filesystems (FAT, NTFS, ext2/3/4, HFS+, and more), and is cross-platform (Windows, Linux, macOS, BSD). It's been maintained for over two decades by volunteers at CGSecurity, which speaks to its reliability and dedicated user base.

This isn't magic—it can't recover data that's been physically overwritten—but for recent accidents, it's incredibly effective. The fact that such a powerful tool is free and open-source is a win for the community.

How to Try It

Ready to play data detective? Here's the quick start:

  1. Head to the GitHub repo: All the information and downloads are at https://github.com/cgsecurity/testdisk.
  2. Download the right package: Navigate to the releases or the download section on the site for stable binaries for your operating system.
  3. Read the documentation first: Seriously. Before you point it at a failing drive, read the step-by-step instructions. The best practice is to recover files to a different physical drive than the one you're scanning to avoid overwriting the very data you're trying to save.
  4. Run it: Launch testdisk for partition recovery or photorec for file recovery. Be prepared for a text-based interface—it's straightforward but requires following the prompts carefully.

Final Thoughts

TestDisk is a classic, essential tool for your sysadmin or power-user toolkit. It's the kind of software you hope you never need, but you're profoundly grateful for when you do. While its interface might feel dated, its effectiveness is timeless. For developers, it's also a fascinating study in how file systems and data storage actually work under the hood.

Next time a friend or colleague has a data disaster, you'll know what to recommend. Just remember: stop using the affected drive immediately for the best chance of recovery.


Found this project helpful? Follow us @githubprojects for more cool tools and deep dives from the world of open source.

Back to Projects
Project ID: 0b3d267f-541d-44d6-a39a-5128e47600e9Last updated: December 27, 2025 at 10:40 AM