I have a scenario where I need to revert the changes from the 3rd last merge request in GitLab. The merge request was successfully merged into the main branch some time ago.
I am aware of the revert button in GitLab’s UI for the most recent merge requests, but I am not sure if or how this works for older merge requests, especially when they are not the most recent ones merged.
Could someone guide me on how to approach this? Ideally, I want to undo just the changes from that specific merge request without affecting subsequent commits or merge requests.
Anshuman Srivastava is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
I’m not familiar with gitLab, there might be an easy solution on the ui.
However you can definitely use git revert <hash-of-unwanted-commit>
from the command line
I would create a new branch, use git revert in the new branch, check weather it did what you wanted, and merge