how to hard reset branch in git code example Example: git checkout reset hard git checkout reset HEAD~1