Master Git

Undo git add

git reset

Undo git commit but keep current files

git reset --mixed HEAD~1

Undo git commit and restore old files

git reset --hard HEAD~1

Return to the last commit

git reset --hard HEAD~0

Create a branch

git branch dev

Go to that branch

git checkout dev

Push that branch to remote

git push -u origin dev

Merge that branch to current branch

git merge dev

Delete that branch

git branch -d dev
git push origin --delete dev