Skip to content
Local

Developer

Git Cheat Sheet

Search everyday git commands by what you want to do, including how to undo commits, stashes and merges, and copy each one.

Runs in your browser. Nothing leaves this device.

Open Git Cheat Sheet

Free, no account, no watermark and no daily limit.

Open Git Cheat Sheet

How to use Git Cheat Sheet

  1. 1Type what you want to do, such as “undo commit”.
  2. 2Narrow the list by topic if you like.
  3. 3Copy the command and replace the parts in angle brackets.

Questions

How do I undo my last commit?

git reset --soft HEAD~1 undoes it and keeps the changes staged. If the commit is already pushed to a shared branch, git revert is safer.

What does “Careful” mean?

Those commands throw away work or rewrite history that others may have pulled. Check git status first.

switch or checkout?

git switch is the newer, clearer command for changing branches. git checkout still works.

Is it free?

Yes. No account, no watermark and no daily limit.

Esc