Back to Cheat SheetsTooling · Beginner
Git cheat sheet
Everyday commands plus the recovery ones you need under pressure.
Daily flow
Branch
git switch -c feature/checkout-testsStage and commit
git add -p && git commit -m "add checkout specs"Sync
git pull --rebase origin mainPush
git push -u origin HEADInspect
Status / log
git status -sb; git log --oneline --graph -10Diff staged
git diff --stagedWho changed it
git blame path/to/fileRecovery
Undo last commit, keep changes
git reset --soft HEAD~1Discard local changes
Irreversible
git restore .Stash
git stash push -m wip && git stash popFind lost commit
git reflogGo beyond the reference
Book a free demo class and apply these commands on live project work.