Tools Tips: How to recover lost data from an SD card

Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026

The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.


Here’s how I recovered (or tried to) lost data from an SD card.

As usual I write those posts to remember how, as this is the 2nd time I do this procedure and I always have to search how to do it.

I happened to run into trouble with my photography hobby 2 times and SD cards in the past couple months:

  1. an SD card appeared empty on the computer and wasn’t readable anymore from the camera (a camera firmware issue), and I had a few days worth of pictures on it
  2. I accidentally deleted a picture I didn’t want to delete, directly on camera, and that was a good picture

There’s a lot of mess when you look for disk recovery, maybe slightly in panic because you lost precious stuff, and many of the things you’ll find are paid options.

photorec (GitHub here) is a free option, actually it’s free GPL-licensed software, which is even better than “just” free.

It’s a command line tool.

Basically tries to retrieve all data that was stored on an SD card (or another kind of disk storage) even after it was deleted.

In the first case I was able to recover my pictures. In the second case it didn’t work, it was a very different use case, but at least I know I tried.

There’s an official site with docs and also a complete documentation in PDF available

Download it from https://www.cgsecurity.org/wiki/TestDisk_Download

On a Mac, install it using Homebrew using brew install testdisk (photorec comes with another tool called testdisk used to check disk partitions) and then run it with

sudo photorec

Lessons in this unit:

0: Introduction
1: How to fix the ffmpeg not found error with youtube-dl
2: How to set up hot reload on Electron
3: How to disable 1Password in an input field
4: ▶︎ How to recover lost data from an SD card
5: Pasting code snippets in Discord
6: Remove EXIF data from images
7: Searching for the perfect e-ink writing device
8: Syntax highlight any block on a Web Page
9: What is a webhook?
10: What's the best platform to deploy your projects?
11: Scraping with Puppeteer
12: Why use a preview version of a browser?
13: A practical guide to Homebrew
14: How to fix the xcrun invalid active developer path error in macOS