Revert
Revert (Rollback) can be used to undo previous merge changes, allowing you to quickly and safely roll back erroneous merges or unwanted changes.
In GitCode Pull Requests, the Revert operation allows you to create a new Pull Request to roll back previous merged changes, restoring the project to its previous state.
How to Use Revert
Revert a PR
-
After clicking on "Pull Requests" from the project page, select the PR you want to revert.
-
Click the "Revert" button on the PR details page.
-
In the pop-up confirmation box, select the branch you want to revert to and click "Submit."
Review and Merge:
If you check "Revert with a new Pull Request," you will be directed to the new Revert Pull Request page. After clicking "Create," the PR will enter the review process. Once approved, you can merge it into the target branch to perform the rollback.
Revert a Commit
-
On the project details page, click "History" to view the list of historical commits.
-
Select the commit you want to revert.
-
Click "Revert" after selecting "..." at the top right corner of the commit details page to revert that specific commit.
Limitations of Revert
Although Revert is a powerful tool, it has some limitations:
- It may introduce new issues: Rolling back changes might introduce new issues or conflicts, requiring careful review.
- Not applicable in all situations: Revert is suitable for situations where you need to undo previous changes but not for all types of problems.
Revert is a safe and efficient rollback method, suitable for undoing incorrect submissions during collaborative development. By creating new commit records, it maintains the integrity of the history and provides a clear rollback trail for the team.