Inside Visual Studio 2015 how to reverse / undo commit in Git?

1

I have a commit made by a developer in the remote Git repository hosted in VSTS that needs to be rolled back. From Visual Studio, without going to command prompt how do I reverse the commit?

    
asked by anonymous 23.08.2017 / 21:20

2 answers

4

For the English language version:

Team Explore > Branchs > Right click on Branch > View History

A list will appear with the commits, right-clicking on some you have the Revert option.

    
23.08.2017 / 21:28
1

If the code is already in the repository in VSTS, you will need:

  • Reverse the commit locally
  • Make push -force

It is not possible to reverse commit in a repository directly in VSTS, so both steps. What is more a characteristic of Git than of VSTS.

In Git you always interact with your repository and send it to the server. Git is a DVCS , not a CVCS, the changes are always local and replicated to the repositories, unless you connect via SSH to a Git server, which is not supported in VSTS.

    
24.08.2017 / 03:14