Git Scenario Solver & Command Generator
Interactive guide to resolving tricky Git states. Pick your scenario, customize branch names or commit messages, and get the exact command sequence with safety checks.
You made a commit too early. Move HEAD back one commit while keeping all your edits staged.
Completely throw away the last commit and all modifications in the working tree.
Fix a typo or rewrite the message of your most recent unpushed commit.
Forgot to stage a file before committing? Combine it into the last commit without creating a second commit.
Combine multiple messy exploratory commits into a single clean commit.
Rename the branch you are on, update tracking, and delete the old branch on GitHub/GitLab.
Do not use git reset on shared branches. Use git revert to publish a new commit that inverts the bad change.
Clean up clutter by deleting all local branches whose pull requests were merged.
Accidentally deleted a branch or ran git reset --hard? Git reflog remembers all HEAD states.
Default git stash ignores newly created files. Use -u to store untracked files too.
Undo last commit, keep staged files
SAFEYou made a commit too early. Move HEAD back one commit while keeping all your edits staged.
What these commands do:
About This Tool
Rather than memorizing git reset flags or reflog syntax, pick the situation you are in ("undid too much", "recover lost stash", "squash last 3 commits") from a searchable list, fill in any branch names or commit messages, and get the exact command sequence plus a breakdown of what each line does.
Commands are generated purely for you to review and run in your terminal. Zero repository access, zero telemetry.
Key Features
- Category filters: Narrow scenarios to Undo & Reset, Commits & History, Branches, or Stash & Recovery.
- Live search: Matches against each scenario's title and description as you type.
- Risk badges: Every scenario is tagged Safe, Notice, or Destructive with warning banners on risky operations.
- Editable parameters: Dynamic inputs for branch names, messages, or paths update the command in real time.
- Step-by-step explanation: Each generated command sequence includes a breakdown of what it does.
- One-click copy: Copies the full multi-line shell command sequence ready for your terminal.