Git Command Cheatsheet
About this tool
reset, rebase, and force-push are easy to point the wrong way. Look up the task, and inspect status before undo commands.
Features
- Branches, commits, remotes, undo
- Commands plus when to use them
- A lookup, not a full Pro Git replacement
How to use
- Browse branch, commit, or remote sections.
- Copy the command.
- Backup the branch before history rewrites.
When to use it
- Pushed to the wrong branch
- Amend the last commit message
- Rebase before merge, carefully
Examples
- git log --oneline for a short history.
- git restore --staged <file> unstages without dropping worktree edits.
FAQ
Replace a GUI?
This is a CLI reference. Use your IDE for messy conflicts.
Accidental force-push?
Recover from someone else’s clone or reflog quickly. The sheet cannot un-push.
Back to DevOps Tools Hub