That’s the fear every engineer feels the moment after a git reset. You know what you did. You know the commit is gone from HEAD. But what about the flow of work? The audit trail? The evidence of what was changed, when, and why? In environments with strict compliance rules or security audits, that missing data isn’t just inconvenient—it’s a risk.
Git reset is a powerful, blunt tool. It rewrites history. It can clean up mistakes, remove commits, or bring a branch back to a known state. But its very nature makes tracking changes harder. A hard reset (git reset --hard) not only moves the branch pointer but erases uncommitted changes. A soft reset keeps changes in the working directory, but the commit history still shifts. Mixed resets sit in between. In all cases, your original commit SHA may vanish from the branch you were working on.
The problem is simple: auditing a git reset means finding what was there before and proving it. Without a plan, that’s tedious or impossible. The object database still stores data until garbage collection runs, but you need precise commands and discipline to recover it. For example:
git reflog
This shows where your branch pointers have moved, letting you locate the commit SHA from before the reset. With that SHA, you can inspect with:
git show <sha>
or even restore with: