how to make git hard reset with command line code example Example 1: git reset hard git reset --hard Example 2: git reset --hard one step git reset --hard HEAD~1