I am using git repository in my project. I have accidentally pushed 2 commits which I shouldn't have. And in between some one has committed on top of it. Is it possible to remove my pushed commits or I have to remove my code changes and push it as new commit, since some one has committed on top of it.
Git Master branch :
Commit A // by me
Commit B // by me
Commit C // by some one
Now I have to delete Commit A and B leaving Commit C. Any help will be really appreciated.