Look up the Git command for a task

Find the Git command for a repository task without executing it.

freeworks offlinenothing uploaded
ToolGit Command Reference
Input
Output
Put this on your own site

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.

Preview

How it works

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.

  • An empty search lists the included porcelain commands without assuming a repository, branch, path, or remote.
  • Destructive flags stay visible because reset, restore, revert, and clean affect different repository states.

Worked example

Undo a commit
Search in plain words
Input
											undo last commit
										
Output
												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
											

When to use this

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.

Edge cases

  • git reset --hard HEAD overwrites tracked index and working-tree changes but leaves untracked files, so its row does not promise a completely clean directory.
  • git revert records a new inverse commit, while git reset moves a branch tip; they remain separate undo tasks.
  • git diff main..feature compares the two tip trees rather than calculating only changes after their merge base.

References