how to delete a commit in git local code example Example: git delete local commit git reset --hard origin/<branch_name>