Use interactive rebase. For example, to go back 5 commits:
git rebase -i HEAD~5
Then in the editor which pops up, delete the line containing the commit you want to remove.
Use interactive rebase. For example, to go back 5 commits:
git rebase -i HEAD~5
Then in the editor which pops up, delete the line containing the commit you want to remove.