Git Command Builder
Describe what you want, get the exact git command.
- $19 Free
- 30 sec
- No signup
Pick what you're trying to do
Set the details
Copy the git command
You get: The exact git command for your goal, explained before you run it.
What are you trying to do?
Run this
git reset --soft HEAD~1
git reset --soft HEAD~1 - Moves HEAD back one commit. Your changes stay staged, ready to re-commit.
Stop guessing which git command to run
Git has one flaw that trips up nearly everyone: the command you need rarely matches the words in your head. You want to 'undo the last commit', but git wants 'reset --soft HEAD~1'. You want to 'take that fix from the other branch', but git wants 'cherry-pick'. This builder closes that gap. You describe the goal in plain English, and it hands you the exact command - plus a one-line explanation of what it does before you press enter.
Everything runs in your browser. Nothing you type is sent anywhere. The commands are generated locally from a fixed set of correct git patterns, so you get the same answer offline that you would get online.
The commands most people get wrong
- Undo the last commit: git reset --soft HEAD~1 keeps your changes staged; --mixed unstages them; --hard destroys them. The word 'undo' hides three very different outcomes.
- Change a commit message: git commit --amend rewrites the last commit - safe only before you push, because it changes the commit hash.
- Undo a commit that is already pushed: use git revert, not reset. Revert makes a new commit that cancels the old one, so shared history stays intact.
- Move a fix between branches: git cherry-pick <hash> copies one commit; it does not move the whole branch.
- Throw away uncommitted edits: git restore <file> or git restore . - this is unrecoverable, so it is flagged as destructive above.
Reset vs revert is the one to memorize
reset rewrites history and is only safe on commits you have not pushed. revert adds a new commit and is always safe on shared branches. When in doubt on a branch other people use, revert.
How to read the destructive warning
Some git operations delete work permanently. This tool flags them with a red warning: reset --hard and restore both throw away uncommitted changes with no undo. Before running either, the safe move is to commit what you have (even to a throwaway commit) or run git stash. Committed work can usually be recovered from the reflog for a few weeks; uncommitted work that you discard is gone the instant you press enter.
Using this with Claude Code
Claude Code can run git for you, but it is worth knowing what it is about to do. A good pattern is to ask Claude to explain the plan first: 'walk me through the git commands you would run to undo the last two commits but keep the changes, and stop before running anything'. Then check its plan against the command this builder gives you. When the two agree, let it run. When they disagree, you have caught a mistake before it touched your history.
A safety habit that pays for itself
- Before any history-rewriting command (reset, amend, rebase), note your current commit hash with git rev-parse HEAD so you can always get back.
- Prefer restore and switch over the older checkout - they are the modern, less-ambiguous commands for the same jobs.
- On any branch other people pull from, never force-push a rewrite unless you have coordinated it. Use revert instead.
- When a command feels scary, run git status and git log --oneline -5 first so you know exactly what state you are in.
- Learn git reflog. It is the safety net that lets you recover 'lost' commits after a bad reset - as long as the work was committed.
Frequently asked questions
Does this tool run git commands for me?
No. It only generates the correct command text and explains it. You copy it into your own terminal and run it yourself, so you stay in control of your repository.
Is anything I type sent to a server?
No. Every command is built in your browser from a fixed set of patterns. There is no network request, no logging, and no signup.
What is the difference between reset and revert?
reset rewrites history and is only safe on commits you have not shared. revert creates a new commit that cancels an old one and is safe on branches other people use.
Can I recover from git reset --hard?
You can often recover committed work via git reflog for a few weeks. Uncommitted changes discarded by reset --hard or git restore are gone permanently.
Why does it use switch and restore instead of checkout?
git switch and git restore are the modern commands that split the many jobs of checkout into clearer, less error-prone pieces. On very old git versions, checkout still works.
Is amend safe?
Yes, as long as you have not pushed the commit yet. Amending changes the commit hash, so amending a pushed commit forces you to force-push, which can disrupt teammates.
Liked this tool? The club is the next step.
Join Claude Code Club for $9/month. 650+ lessons, weekly updates, and the workflows behind every tool on this site.
- No experience needed
- Cancel anytime
- Updated weekly
