list branches
git branch [-a to include remote branches]
create branch [from master]
git checkout -b HS-1234 [master]
update master, rebase and push
git checkout master
git pull
git checkout HS-1234
git rebase master
git push -f origin HS-1234
(2-step merge from master)
git fetch
git merge origin/master
delete branch
local: git branch -D HS-1234
remote: git push origin --delete HS-1234
rename branch
git branch -m HS-4321
undo git add (unstage)
git reset file.txt
revert changes
git checkout file.txt
stash and un-stash
git stash
git stash pop
git stash list
show diff of a stash
git stash show -p stash
@{0}
remove most recent stash
git stash drop
apply a single commit (cherry-picking)
git cherry-pick a1b2c3
create and apply diff file
git diff COMMIT1 COMMIT2 > diff.patch
git apply --stat diff.patch
git apply --check diff.patch
git apply diff.patch