Revert a Merge Request

With a single click, you can revert an MR, create a new branch with the revert, and start a new review. The ability to do this is useful when it is necessary to revert a problematic MR. The revert operation undoes a commit in a forward-moving fashion. This means that a new revert commit will be created instead of rewriting the history. All original merged commits will be preserved. The revert commit will have inverse merge changes. The revert operation create a new commit that undoes the changes, effectively reversing the effects of the unwanted merge.

After a merge request has been merged, you can use the Revert Changes icon Revert Changes button. The changes that were merged into the target branch will be reverted. The Revert Changes operation will:
  1. Create a new branch forked from the target branch.
  2. Create a new commit with inverse changes on top of the newly-created branch.
  3. Create a new MR.
Here's how to do it:
  1. Click Revert Changes icon Revert Changes to display the Revert Changes dialog.


    Description of revert-changes-dialog-page-1.png follows
    Description of the illustration revert-changes-dialog-page-1.png

    [revert-changes-dialog-page-1.jpg : desc-revert-changes-dialog-page-1]

  2. The Review Branch field is automatically filled out for you.
    The Create branch icon to the right indicates that this branch will be created for you. Notice the informational message under the review Branch field: Branch branch-name will be created from target-branch-name . The target branch is the branch where the review changes are going to be reapplied (and added to the top of) after the review.
  3. The Revert Changes information box summarizes the actions that will take place.

    Notice that the Revert Changes button at the bottom of the page is grayed out. That means you are required to fill in some information on one of the pages that follow this one.

    Click Next to display the second page (Reviewers) of the dialog.

  4. The Reviewers field is required, so you must select a reviewer from the list.
    Notice that the Revert Changes button becomes active after you choose a reviewer. You can click this button now, unless you want to click Next and go to the (optional) Details page where you can specify any linked issues, linked builds, or tags or continue to the (optional) Description page where you can add information about the revert operation you are about to perform.
  5. Click Revert Changes.

    A new merge request is created for you, as was explained in the third bullet in the previous page's informational box.

  6. Click Merge to revert the changes you made in the previous merge.
Sometimes you might not be able to perform this operation, like when files have conflicts. These conflicts must be manually merged before proceeding. If the merge you are trying to revert was done through the user interface (not the Git command line), you should be able to revert the changes.