Of course, you can click on a commit 2 times and the files that have been changed will appear in Team Explorer, but this is not very convenient. Is it possible to "replace" the state of a project with a state of a commit, just to see what and how it was at that time, without deleting other commits and creating new ones?
2 answers
If the task is to just see the commit without creating new ones or rolling back through the commit tree, then the simplest thing is to create a separate branch. Right-click in Visual Studio on the current branch (bottom right of the window) and select View History ... A tab with a commit tree will appear.
We right-click on the right commit and select New Branch ... (all changes of the current branch must be closed, otherwise it will not be possible to switch to it after creating a branch). After you have worked with the new branch, you can delete it in Team Explorer (after switching to another branch).
The solution to the problem was found thanks to Pavel Goroshkov here: https://vk.com/wall-38655318_37990
In Visual Studio itself, this will not work. I installed the Git Extensions program and opened the repository / folder with the Visual Studio project in it. They chose a commit, PCM on it and chose "Roll back the current branch here" and in the appeared window select "Hard: ......"
- oneSimilarly, in the studio "Reset -> With the removal of changes (hard)". - Monk
- Without losing commits, but with switching the working directory - in the screenshot, the button "Switch to revision". Just what you advised in the comments. In the studio, I did not find a similar button. - Monk
- and git checkout? Ie go to the desired repository and git checkout with the identifier of the desired commit. - QuaternioNoir



checkout) - be sure to write to Torvalds, please the old man with new unexplored features. (This is a joke. Of course, I know aboutshow,cat-file, and even more sophisticated ways, but “canonical” is, of course, onlycheckout). - aleksandr barakin