One of my teammates mistakenly pushed some commits to our main development branch. We\'re a small, collocated team. Our remote repository is hosted on an inter
What you are trying to do is very risky.
indeed you can revert and delete the commits that you have already pushed to the repo but if someone has already pulled your changes and he has the commitId that you are going to delete, the repo can become "unstable" and git will not be able to handle the pull and pushes since you deleted commit that is now removed from the history.
Do this (revert and delete commit ) only and only if no one has pull this commit yet.