Github revert in visual studio 2013

I'd like to know how to revert a project I got from github to a previous version. Let's say the latest project version is 4.10, however I'd like to work with 4.9 in my code, because in 4.10 the project moved from VS2013 to 2015 and I can't use it on Win 7. I forked the project and, as far as I know, you can't clone anything else beside the latest versions (not exactly true as shown here How to clone a specific Git branch? but it's to late - I already cloned the 4.10).

So I installed 'git for windows' command-line tools to have access to git revert - which I think is required for this task. How do I revert to a previous version? Somewhere there was info I need a hash of the version I wan to get back to but where can I find that on github?

Thanks in advance, drinker


In that case, start by fetching everything from the origin; this is a lazy/comprehensive choice. You could choose to be more specific, but that should hardly matter since you already cloned most of the tree.

edit: git-fetch options that should actually work (one of these should do "the trick")

> git fetch origin

> git fetch --all

> git fetch origin -t

> git fetch --all -t

Then checkout the 4.9 branch, or tag, or commit_id (as you see fit) as a fork branch.

> git checkout -b my_fork 4.9
  • "-b" creates a new branch if it does not already exist; "-B" is like a forced version, not recommended, but available
  • "my_fork" can be named whatever you like
  • "4.9" can be changed to target any useful refspec that you like.
  • For the rest of the options around git-fetch and git-checkout, read the man files.

    链接地址: http://www.djcxy.com/p/16054.html

    上一篇: 如何克隆bitbucket中的特定分支

    下一篇: Github在视觉工作室2013恢复