how to revert the commit in local git code example Example: revert last commit $ git reset --soft HEAD~1