how to revert hard reset git from local code example Example: git reset --hard one step git reset --hard HEAD~1