You’ve given someone break-glass access to your Git repository. Maybe an outage. Maybe a production bug. It’s fast, it’s urgent, it’s high-stakes. But when the fire’s out, the clock is still ticking—because leaving that access alive is an open door you never meant to keep open.
This is where git reset becomes more than a commit command. Used the right way, it is the scalpel to remove temporary changes, undo break-glass commits, and restore your repo to the known-good state. It’s precision control for the moments when “just revert” isn’t enough.
Why Break-Glass Access Creates Risk
Break-glass access grants immediate, unrestricted control. It bypasses normal security and review processes, letting someone push fixes directly to your main branch. This speed is essential in emergencies, but every second it remains in effect increases the chance of mistakes, conflicts, or quiet exploits. Audit trails get tangled. Approval flows vanish. The repo becomes a single point of failure—your main branch could drift from the truth.
When to Deploy git reset After Break-Glass
Once the emergency is over, treat your codebase like a crime scene. Identify every commit made under break-glass conditions. Was code pushed without review? Were there config changes meant to be temporary? git reset can surgically remove them, either with a soft reset to keep local changes staged, or a hard reset to return the branch to a previous clean commit. In both cases, it restores a clear point-in-time baseline.
Best practice: locate the last verified, safe commit before break-glass activity. Run: