I found this interesting Git revert
The beauty about this problem is, the best feature ot git revert
is creating the problem. The biggest advantage of using git revert from git reset is
It doesn’t change the project history, which makes it a “safe”
operation for commits that have already been published to a shared
repository. For details about why altering shared history is
dangerous, please see the git reset page.
git revert
in itself is a commit. You should have used git reset --hard
, I am guessing you had a reason for using git revert.
It's important to understand that git revert undoes a single commit—it
does not “revert” back to the previous state of a project by removing
all subsequent commits.
To undo a merge before you push commits.
git revert -m 1 <commit>
But remember the real problem here is, you have to revert the revert before you want to commit the brach again, or re-merge it again.
Anyways, I have found a wonderful person on this planet, who explained in detailed exactly the same problem. Yes, Exactly the same problem. I am excited to present him here:
Linux Torvalds explaining the git-revert conflict
I have a master branch. We have a branch off of that that some
developers are doing work on. They claim it is ready. We merge it
into the master branch. It breaks something so we revert the merge.
They make changes to the code. they get it to a point where they say
it is ok and we merge again.
When examined, we find that code changes made before the revert are
not in the master branch, but code changes after are in the master
branch.
This might also help you:
Re-doing a reverted merge in Git