I have a commit done by a developer in the remote Git repository hosted in VSTS that needs to be rolled back. From Visual Studio, without going to the command prompt or how to revert the commit?
I want to undo the commit through Visual Studio without using a command prompt.
To undo changes associated with a specific commit, developers should use the git revert command. To undo every change that has happened since a given commit occurred, use git reset.
Visual Studio supports discarding uncommitted changes to a file by reverting the file to its last committed version. If the file is in the Changes section, right-click it and choose Undo Changes to discard all changes to the file since the last commit.
Selected answer is not correct. In order to undo a commit you need to select reset, not revert. Revvert will make a new commit with code contained in previous commit. Where reset will actually delete the commits after the selected version.
Open the "Changes" tab in Team Explorer. Select "Actions", then "View History" to view the history of the repository. Identify the commit that you want to revert, right-click on it and select "Revert" from the context menu.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With