Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to revert git pull request in Visual Studio online?

A team member made a pull request using git for visual studio online. It was approved and merged in successfully, however we would like to undo that and revert to the state of the branch prior to the PR.

Locally, I'm aware of a way to do this. It would be to get a version of our master branch, revert to the earlier version in a branch, and commit it like a standard PR. However, is there not a way in the VSTFS online to simply "undo"?

Thanks

Update

My apologies. I didn't clarify that this was for TFS 2015, and apparently that is not available as a feature in 2015.

like image 272
Kat Avatar asked Sep 21 '17 19:09

Kat


People also ask

How do I revert a pull in git Visual Studio?

To do the same in Visual Studio, right-click the commit you want to revert and then select Revert. After you confirm your action and the operation is complete, Visual Studio displays a success message and a new commit appears in the Outgoing section.


1 Answers

You can revert the completed pull request directly in VSTS:

  1. Navigate to the completed Pull Request : Code >> Pull Request >> Completed
  2. Select and open the Pull Request which you want to be reverted.
  3. Click More Actions (Behind the Delete source Branch button) >> Revert
  4. Click Revert on the opened Revert pull request dialog.
  5. Click Create Pull Request in the revert succeeded dialog.

    Revert succeeded in creating the new branch Dev-revert-from-master.

  6. Click Create >> Approve >> Complete >> Enable the checkbox for Delete Dev-revert-from-master after merging >> Complete merge

Check the code in Master branch, it should be reverted back.

enter image description here

like image 113
Andy Li-MSFT Avatar answered Oct 20 '22 01:10

Andy Li-MSFT