GitLab撤销合并时,“Revert in branch”下拉选哪个分支?
Got it, let's clear this up for you—you accidentally merged test-1 into Master and need to undo that merge, and you're stuck on which branch to select in the dropdown? Totally understandable, let's break it down simply:
First, let's clarify what that dropdown does: it's asking which branch you want to apply the revert commit to. Since your goal is to fix the Master branch (the one that got the accidental merge), here's what you should choose:
- If you're currently checked out to
Master(which is probably the case, since you just merged into it), selectMasterdirectly. This will create a new commit onMasterthat undoes all the changes brought in by thetest-1merge. YourMasterbranch will go back to exactly how it was before the merge happened. - If you want to play it safe and test the revert first (before touching
Master), you can create a new branch fromMaster(likerevert-test-merge) first, then select that new branch in the dropdown. Once you verify the revert works as expected, you can merge this test branch back intoMaster.
A quick note: Reverting the merge won't delete anything from your test-1 branch—all its changes are still intact. If you later decide you do want to merge test-1 into Master, you can do that normally (you might just need to resolve any new conflicts if Master has changed since the revert).
内容的提问来源于stack exchange,提问作者lynxx

