Undo git mistakes.
Every developer has done it: a quick commit, then the sinking realization it landed on main instead of a feature branch. The usual next move is a frantic search that surfaces ten conflicting answers, half of them reaching for git reset --hard on the wrong ref, which is how work disappears for good. Recovering is not hard once you know the four commands, the danger is guessing under pressure. This blueprint hands you the exact, safe sequence instead.
A small git recovery helper. You tell it what went wrong, starting with the classic case, a commit made on main that belongs on its own branch, and it returns the precise commands to move that commit onto a new branch and reset main back to where it should be, without losing your work. Each line comes with a short note on what it does, so you understand the fix rather than paste it blind.
You watch it come together in the task workspace: the agent scaffolds the tool, wires the command logic, and checks the recovery flow against the committed-to-main scenario before handing you a live preview. The code lands on a branch in your repository with a pull request ready.
The first version covers the common case and grows from there with plain follow-up messages:
Each follow-up wakes the same repository and the agent continues on its own code.
Will these commands ever delete my work? No, the steps are ordered to preserve your changes first; the tool favors moving and resetting over destructive resets.
Do I need to understand git internals? No, you describe the mistake in plain words and get the exact commands, each with a one-line explanation.
Can it handle mistakes beyond committing to main? Yes, that's the starting scenario; ask it to cover wrong-branch commits, pushed commits, or bad merges and it extends the tool.