git reset --hard a branch to master code example Example: git checkout reset hard git checkout reset HEAD~1