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.

Private by architecture: All processing is 100% client-side memory. Your data never leaves this browser tab.
Scenarios
Undo last commit, keep staged files safe

You made a commit too early. Move HEAD back one commit while keeping all your edits staged.

Undo last commit and delete all changes destructive

Completely throw away the last commit and all modifications in the working tree.

Change the message of the last commit safe

Fix a typo or rewrite the message of your most recent unpushed commit.

Add a forgotten file to the last commit safe

Forgot to stage a file before committing? Combine it into the last commit without creating a second commit.

Squash the last N commits into one notice

Combine multiple messy exploratory commits into a single clean commit.

Rename current branch (local and remote) notice

Rename the branch you are on, update tracking, and delete the old branch on GitHub/GitLab.

Safely undo a commit already pushed to remote safe

Do not use git reset on shared branches. Use git revert to publish a new commit that inverts the bad change.

Delete all local branches already merged into main safe

Clean up clutter by deleting all local branches whose pull requests were merged.

Recover commit deleted by rebase or reset safe

Accidentally deleted a branch or ran git reset --hard? Git reflog remembers all HEAD states.

Stash everything including untracked new files safe

Default git stash ignores newly created files. Use -u to store untracked files too.

Solution & Terminal Commands

Undo last commit, keep staged files

SAFE

You made a commit too early. Move HEAD back one commit while keeping all your edits staged.

Shell Commands
 

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.

Frequently Asked Questions

What do the SAFE / NOTICE / DESTRUCTIVE badges mean?
Safe commands (like git reset --soft or git revert) do not discard work. Destructive scenarios (like git reset --hard or a force push) show a red warning banner because they can permanently overwrite commits or files.
Does this tool run any Git commands for me?
No. It only generates the exact shell command sequence as text for you to review and run yourself in your own terminal.
How do I find the scenario I need?
Filter by category (Undo & Reset, Commits & History, Branches, Stash & Recovery) or type into the search box: it matches against each scenario's title and description.
Can I customize things like branch names or commit messages?
Yes. Scenarios that need input (a commit message, file path, or branch name) show text fields above the generated command; edit them and the Shell Commands box updates live.
Is my repository or its history sent anywhere?
No. Everything, including the scenario list and command generation, runs client-side; nothing about your repository ever leaves your browser.