Git commands worth memorising
git status what is actually changed right now
git diff what changed, line by line, unstaged
git add -p stage selected chunks, not whole files
git commit -m "message" save a checkpoint
git switch -c feat/thing new branch off where you are
git switch main back to the trunk
git restore <file> throw away uncommitted changes to one file
git log --oneline -10 the last ten commits, one line each
The two that save you:
git stash park everything, do something else, then git stash pop to get it back
git revert <commit> undo a commit by making a new one, which is safe on shared branches
The one to be careful with:
git reset --hard discards uncommitted work permanently. There is no undo.