Create branch
git branch feature-1
Go to branch
git checkout feature-1
Merge feature-1 to master
git checkout master
git pull origin master
git merge feature-1
(solve potential merge conflicts ...)
git push origin master
Remove local branch
git branch -D feature-1
Remove remote branch
git push origin --delete feature-1
Merge master into branch
git checkout master
git pull origin master
git checkout feature-1
git merge master
Undo changes (not commited)
git stash (save local changes)
git reset --hard (discard local changes)
Undo changes (commited)
git reflog
Note down the ID of the commit we want to go back to, e.g. 6b6271a
git reset --hard 6b6271a