If I use Team Foundation Source Control I can easily rollback to old changeset.
Assuming I have a file with 4 versions, each version have a changset:
- Changeset a126 - Version 1.
- Changeset b347 - Version 2.
- Changeset c560 - Version 3.
- Changeset d912 - Version 4.
Now I found a lot of bugs in Versions 3 & 4 and I want quickly return back to Version 2.
In Visual Studio I can click "View History" on the file, click on Changeset b347 ("Version 2") and then "Rollback".
Now I have a new changeset with the file in Version 2 and I can check-in it (I still have Version 3/4 in my history, so I can also return to them sometime).
In Git, I know there are revert
, reset
(hard, soft) but I don't know exactly what I need to do to reach the same result.
So what is the best way to rollback to old version in Git (preferred via Visual Studio)?