How to revert git pull request in Visual Studio online?

Viewed 20623

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.

2 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

is there not a way in the VSTFS online to simply "undo"?

Not that I know of: reverting, and then pushing the new commit as a new PR remains the simplest option.

Related