The day I lost everything (and got it all back)

Vintage monitor showing error 0x80040E14 data corruption detected segmentation fault core dump system halted lost code reference

There is a particular kind of sick feeling you get when you open your project and realise that weeks of work have quietly disappeared. Not dramatically — no error message, no warning, no explosion. Just gone. Replaced by something older and simpler, sitting there looking innocent.

That happened to me this week while building Cosy Reader.

What actually happened

I had been working through a significant design update — v2.5 of the app, which brought illustrated time-of-day scenes to the library header, an auto-hiding reader bar, a Continue Reading card, edge-to-edge status bar support on Android, and a handful of other things that had taken a good chunk of evenings to get right.

While trying to push the branch to GitHub, something went sideways with GitHub Desktop. I clicked something. The app tried to help. And somewhere in that confusion, it committed an older local copy of the project on top of all my work — wiping out the hero header component, the scene images, the TTS engine, the WordPress.com auth context, the stats screen, the colour extraction utility, and around fifty other files.

The commit message it left behind was called “Save current work.” Which is almost funny.

The recovery

Here is the thing about git: your work is almost never actually gone. The commits that mattered were still in the history. The problem was that newer commits had been stacked on top of them, changing the working state of the files.

Because the repository lives on a mounted filesystem, git’s normal reset commands kept failing — the operating system would not let git unlink and replace files the way it usually does. So instead, a Python script read each file’s correct content directly from the git object store and wrote it back to disk, bypassing git’s file replacement mechanism entirely.

It took a few passes. GitHub Desktop kept seeing “uncommitted changes” and helpfully discarding them. Each time, the same script ran again. Each time, everything came back.

Eventually the branch was clean, the commits were intact, and the build ran. The phone showed the illustrated header, the scene images, the floating bars — all of it.

What I learned

The obvious lesson is about tools. GitHub Desktop is friendly and visual, but its “Discard Changes” button is a sharp edge that does not ask twice. On a mounted filesystem it becomes genuinely unpredictable. The terminal is less friendly but it does exactly what you tell it, nothing more.

But the less obvious lesson is about trust. Not trust in tools — trust in the process. Git is, at its core, a content-addressable store. If a commit exists, its contents exist. Nothing is deleted; it is just a matter of how deep you have to reach to get it back.

Knowing that made the panic shorter than it might have been. The work was not lost. It was just temporarily misplaced.

The irony

Cosy Reader is an app built around the idea that reading should be calm. No noise, no urgency, no algorithms tugging at your attention. Just the writing, offline, at whatever pace you like.

Building it is sometimes the opposite of that. There are build errors, JVM version mismatches, CMake directories pointing at paths that no longer exist, git lock files that refuse to be deleted. Real development is messy in a way that finished software never shows.

I think that is worth saying out loud. Not because the mess is the point — it is not — but because the gap between “this is what I am building” and “this is what building it looks like” can feel embarrassing if you think it should not exist.

It should exist. It always does.

Where things stand

The v2.5 design exploration branch is now merged into main. The illustrated library header rotates through five time-of-day scenes — sunrise hills in the morning, palm coast in the afternoon, dusk pines in the evening, moonlit lake at night, city skyline in the small hours. The app knows what time it is and dresses accordingly.

Everything that was lost came back. The work was not wasted. And somewhere in the recovery, a few things got tidied up that probably needed tidying anyway.

On to the next thing.

Leave a Reply

Discover more from Quiet Builds

Subscribe now to keep reading and get access to the full archive.

Continue reading