Skip to content
TabKiwiTabKiwi

Git Command Reference

Searchable git cheat sheet with explanations, plus step-by-step fixes for common mistakes.

DeveloperRuns in your browser. Your files never leave this device.
Loading tool…

About this tool

The git commands developers use every day, grouped into setup, branching, remotes, history, stashing, tags and undoing changes, each explained in a sentence with a copy button. A separate recipes tab walks through common accidents, such as committing to the wrong branch or losing work after a reset, with the exact commands to recover. Commands that throw away work or rewrite history are highlighted.

How to use Git Command Reference

  1. Search for what you want to do, like rename branch.
  2. Browse commands by group or switch to the recipes tab.
  3. Replace the placeholders in angle brackets with your values.
  4. Copy the command and run it in your terminal.

Frequently asked questions

What is the difference between reset and revert?

Reset moves your branch back and can discard commits, which rewrites history. Revert adds a new commit that cancels an old one, so it is safe on shared branches.

Can I get back commits after git reset --hard?

Usually yes. git reflog lists where HEAD has been, and you can create a branch at the hash you lost.

Should I use git switch or git checkout?

Both work. switch and restore were added in Git 2.23 to split checkout's two jobs into clearer commands.

More Developer tools

View all 91 →