how to remove last commit in github code example Example: remove last commit git git reset --hard HEAD^ git push origin -f