git reset head meaning code example Example 1: git reset head sudo git reset --hard Head Example 2: undo git reset HEAD~1 git reset HEAD@{1}