Git Cheat Sheet

Some commands that are used occasionally and end up needing a stack overflow search.

Hard Reset

Get rid of any commits that are not pushed and reset to origin.

git checkout master
git reset --hard origin/master

Soft Reset

Get rid of commits not pushed but keep the changes.

git reset HEAD~1 --soft