how to delete old commits from gitHub to show a new repository code example Example: how to delete old commits in github git reset --hard HEAD^ git push origin -f