How to delete the last n commit on Github and locally?
问题 I'm trying to delete the last 2 commits in one of my GitHub repositories. I've tried as suggested here : git push -f origin HEAD^^:master. It seems that it works, the last two commits are removed. Then I deleted them from my local repository with git rebase -i HEAD~2. I remove the lines than are related with those commit, and check with git log that they are correctly removed. After that I make some changes in my local repository, make a new commit and push to GitHub. The problem is that in