How do I do a `git checkout` in visual studio 2019?

Viewed 2480

I'd like to go back and look at a commit of the code I previously published. From the command line, it would be git checkout [commit id], but I'd like to do it though Visual Studio (2019) so I don't have to open the command prompt and find/copy the commit id. I don't want to make any permanent changes to the code, I just want to be able to browse/debug the old code.

This seems like it should be a feature in Visual Studio - from the history window, I can see options for Revert, Reset, Cherry-Pick, but I don't think any of those are re-named version of checkout. I tried searching for "visual studio 2019 how do I checkout a previous commit git" (and various wordings), but I can't find the answer.

The solution I've used so far was to make a new branch from the commit I want to look at, then delete the branch when done, but it seems like there must be a better way...

Here is the right-click menu: Commit History Right-Click Menu

1 Answers

Currently, there is not any way to do this in VS. You must do it in a command line. There is a ticket in VS community for adding this feature. You can log in and vote for that. Maybe that helps and you may see it in the next version of VS.

Related