How to build a previous version of my solution?

Viewed 52

I have a project in Visual Studio under GITsource control.

I have made commits to it, but I want to go back to a previous commit, build the solution, and run it, without changing anything.

But when I go to the branch's Version History page and double-click on the commit I want to build, then Build Solution, it builds the most recent version of the solution.

How do I do this?

1 Answers

You should solve this by the command line creating a temporary from the previous commit.

Try issuing the following instructions (that work on Windows too):

git log  --oneline -2

# Copy the older commit hash, then create the temporary branch

git branch temp-previous-commit-branch {{copied-commit-shash}} 

Now ayou really able to build the previous version.

Related