how to revert a commit in local branch code example Example: revert local commit $ git reset --hard HEAD~1