I've a master branch in which there is a file Demo.txt. It has the following 2 lines:
AAAAAA
BBBBBB
A new branch Dev is branched off from the master at this point. The branch Dev now contains Demo.txt with the same 2 lines i.e
AAAAAA
BBBBBB
Lets suppose I checkout master and add a new line to Demo.txt so that the file becomes :
AAAAAA
BBBBBB
XXXXXX
Similarly, I then checkout Dev and add a new line to Demo.txt so that the file becomes:
AAAAAA
BBBBBB
YYYYYY
Now I checkout master and merge Dev into it. There is a merge conflict on file Demo.txt in the 3rd line. Lets suppose the conflict is resolved by keeping entries of both master and Dev branch. Lets suppose the new merged file looks like :
AAAAAA
BBBBBB
XXXXXX
YYYYYY
Now I commit the merge and push it to the remote repository. Let us suppose the commit id of the merge is something like abcdef056fg(only an example). After pushing the merge I discover that there has been some error in resolving the merge conflict and I want to roll back the merge.Also, I want to add one more change to Dev as part of the error fix before merging it to master again.According to the guidelines given in this link by Linus Torvalds - "https://raw.githubusercontent.com/git/git/master/Documentation/howto/revert-a-faulty-merge.txt" , I revert the revert of the merge abcdef056fg. For example, I checkout master,do "revert -m 1 abcdef056fg" which gives me a new commit.I revert the commit again to get the revert of the revert. The revert of revert merge gives me the following Demo.txt:
AAAAAA
BBBBBB
XXXXXX
YYYYYY
I then checkout Dev and add a new file Demo2.txt to it with the following lines;
PPPPPP
I now checkout master and merge Dev again. The new file Demo2.txt is merged correctly into master. But I'm not given the option of resolving the merge conflict of Demo.txt again. Lets suppose I wanted the merge conflict to show up again in Demo.txt so that I could change it to the following:
AAAAAA
BBBBBB
YYYYYY
XXXXXX
instead of
AAAAAA
BBBBBB
XXXXXX
YYYYYY
How do I do it. I don't want to make changes directly on my master because I keep my master branch clean and do not do any development on it. All development is done in the Dev branch and it is finally tested and merged into the master. Also this is a contrived example with a single conflict. Any such merge might have several conflicts which were resolved and committed and I would not like to fix all those in the master. So how do I do it?