For a test I have a simple console app and I commit it (Initial). Then I add a comment and commit it (00). Then I change the comment and commit it (01)
Now I want to sim
If you select a commit to revert, Visual Studio does not "revert to" that point in time - it does a logical removal of the changes that commit introduced. It attempts to remove only the changes that were introduced in that commit.
Consider some series of commits for a single file:
Line one
Line two
Line three
Line four
Line five
Line one
Line 2
Line three
Line 4
Line five
Line ONE
Line 2
Line three
Line 4
Line FIVE
If you want to revert commit 2 - you are trying to undo the changes that it introduced, while retaining the changes introduced in commit 3. The results will be:
Line ONE
Line two
Line three
Line four
Line FIVE
However, there can be conflicts. If commit 2 had changed the same line that commit 3 had changed, the revert would fail with a conflict, and you would have to resolve it to continue.