github - Why do I run into git merge conflicts when I do a revert? -


so i've been trying revert prior version of project. keep getting merge conflicts when git revert. why on earth make sense? i'm saying "i want revert prior version, then" , it's saying need keep of current code. no, want none of it, screwed project somehow , think earlier version wasn't screwed up. know should able resolve these problems, i've never done massive merge conflict before, , don't understand lot of xcode code.

also, if revert commit, go before or after commit? instance...

commit a, commit b, commit c, commit d.

i revert commit b. go? after a, or after b?

$ git revert 8873550de2b6c4bec42cfec4e98600736f01ffb9 error: not revert 8873550... grid view hint: after resolving conflicts, mark corrected paths hint: 'git add <paths>' or 'git rm <paths>' hint: , commit result 'git commit' 

i'm saying "i want revert prior version, then"

actually, you're not:

given 1 or more existing commits, revert changes related patches introduce, , record new commits record them.

given simple history

d [master] | c | b | 

git revert b generates new commit on top of d reverses changes introduced in b (see example below). if changes introduced in c conflict new commit, you'll conflicts.

if revert commit, go before or after commit

neither. you'd end like

e [master] | d | c | b | 

where e's changes reverse c's changes.

if want "go in time" b can use git checkout b (which result in detached head, isn't helpful if want make new changes point), can use git reset move master b, making c , d eligible garbage collection, or can use git branch create new branch @ b.

with information in question can't tell of these want.


Comments