revert the local commit in current branch code example Example: revert local commit $ git reset --hard HEAD~1