git statusShow working tree status
git add <file>Stage a specific file
git add .Stage all changes in current directory
git add -pInteractively stage hunks
git commit -m "message"Commit staged changes with message
git commit --amendAmend the last commit
git commit --amend --no-editAmend last commit without changing message
git reset HEAD <file>Unstage a file (keep changes)
git reset --soft HEAD~1Undo last commit (keep changes staged)
git reset --hard HEAD~1Undo last commit (discard changes)
git checkout -- <file>Discard changes in working directory
git restore <file>Discard changes in working directory (modern)
git restore --staged <file>Unstage a file (modern)
git stashStash uncommitted changes
git stash popApply and remove latest stash
git stash listList all stashes
git stash dropDelete latest stash