How do I reverse/revert a merge conflict during a PR review? #185977
-
Select Topic AreaQuestion BodyI am reviewing a PR a colleague wrote. At one point he made a lot of changes, but all of them were a part of the "accept current", which is what I wanted. The "incoming" was very small and not what I wanted. I clicked on accept current, then GitHub gave me the incoming as the merged conflict! That is NOT what I want!! How do I reverse/revert/abandon this merge conflict, to start over again? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
If the merge has not been completed yet, you can safely abandon the conflict resolution and start over by aborting the merge. When working locally, running git merge --abort will cancel the merge and restore the branch to its state before the conflict occurred. If the conflict was already resolved but not committed, you can restore the correct version of the affected files and re-stage them before continuing. If the merge commit has already been created, you can reset the branch to the commit before the merge using a hard reset. When conflicts are resolved using GitHub’s web interface, there is no direct undo option, so the only way to recover is to close the pull request or push a new commit that corrects the incorrect conflict resolution. |
Beta Was this translation helpful? Give feedback.
If the merge has not been completed yet, you can safely abandon the conflict resolution and start over by aborting the merge. When working locally, running git merge --abort will cancel the merge and restore the branch to its state before the conflict occurred. If the conflict was already resolved but not committed, you can restore the correct version of the affected files and re-stage them before continuing. If the merge commit has already been created, you can reset the branch to the commit before the merge using a hard reset. When conflicts are resolved using GitHub’s web interface, there is no direct undo option, so the only way to recover is to close the pull request or push a new co…