I have a file that in the beginning looked like this
asd
bnm
cvb
Then I added three commits:
1.
asd feature1 c1
bnm
cvb
2.
asd feature1 c1
bnm feature1 c2
cvb
3.
asd feature1 c1
bnm feature1 c2
cvb feature1 c3
Now when I want to revert commit number two by doing
git revert HEAD^
I get an error message like this
error: could not revert 2222222... feature 1 commit 2
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
and my file looks like this
<<<<<<< HEAD
bnm feature1 c2
cvb feature1 c3
=======
bnm
cvb
\>>>>>>> parent of 2222222... feature 1 commit 2
And I just don't understand why. My assumption is that it would work like Edwar Thomson explains it in his answer to this question: git revert: Why do I get conflicts? I didn't edit line 2 twice and should not get a conflict. What am I missing?
I expect the result to be
asd feature1 c1
bnm
cvb feature1 c3
without any conflicts.