#CommandUse
1git statusCheck current changes/status
2git pullGet latest code from GitHub
3git add .Stage all changes
4git commit -m "message"Save changes in Git
5git pushUpload changes to GitHub
6git log --onelineSee commit history
7git log -1 --onelineCheck current HEAD
8git branchCheck branches
9git switch branch-nameSwitch branch
10git diffSee code changes
11git restore fileDiscard changes to a file
12git revert COMMIT_IDSafely undo a commit
13git reset --hard COMMIT_IDMove back to an old commit
14git reflogRecover/find previous HEAD
15git remote -vCheck GitHub remote
16git fetchGet remote updates without merging
17git clone URLDownload a repository
18git stashTemporarily save uncommitted changes
19git stash popRestore stashed changes
20git show COMMIT_IDSee what a commit changed