'Visual Studio GIT Reset to Previous Commit Problems
I decided I wanted to revert back from Version 31 to Version 69 on my Visual Studio Project (Its using GIT and TFS)
I was able to use the Team Explorer and press reset and seemingly go back to version 69 state.
However, now when I go to commit, all changes from commits 57 and 31 are staged to be committed, even though they are not in my Visual Studio Solution explorer.
I don't want the information from the new commits, I essentially just want version 69 to be the newest. Is there anyway for me to do that?

Solution 1:[1]
Although this question passed long time. I met one similar situation. I'm using VS with Git self.
I had mistaken on reset-hard to one old commit. All log and commit latest what I need was gone.
I'm tried to do following action.
- go to your solution and find hide folder .git.
- find log folder and open HEAD file. There must be one line include one commit you want but not show in VS. remember commit-id (2nd one in same line).
- open your cmd prompt.
- go to your git path. such as:C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd
- type cmd: git -C your solution folder+.git reset your commit id.
- Then go back to VS, those file still not back but you can find all change marked in view-Git change. Just select all change then cancel changes. All files related your commit should be back.
Reminder, I'm not sure if my solution is available for all situation. So it's better keep one more copy for your solution. Otherwise it takes more loss. :)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
