how to get rid of my commits in github code example Example: how to delete old commits in github git reset --hard HEAD^ git push origin -f