Find the Git command for a repository task without executing it.
The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.
Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.
Every query word must occur somewhere across a curated task, command, and caution row before that row is shown. Placeholders such as <branch> remain literal, so the result is documentation to adapt rather than a shell invocation.
undo last commit
2 of 50 commands match "undo last commit": Task Command Notes Undo last commit, keep changes staged git reset --soft HEAD~1 Moves HEAD back one commit Undo last commit, keep changes unstaged git reset HEAD~1 Moves HEAD back, unstages the changes
Working-tree preparation uses status, diff, add, restore, and commit; shared remotes use fetch, pull, push, merge, and rebase; recovery chooses among revert, reset, restore, and reflog according to the state that must change.