git checkout — 取出想要的文件

用git checkout取出想要的文件:

git checkout Makefile — 取出最近提交的Makefile
git checkout a98d3ca48c6500f97802587c8e11b3305731bb6b Makefile — 取出指定版本的Makefile

git checkout -b newBranch — 取出最近提交的文件并且创建newBranch分支
git checkout -b newBranch a98d3ca48c6500f97802587c8e11b3305731bb6b — 取出指定版本并且创建newBranch分支

猜你喜欢

转载自zhangyf1987hb.iteye.com/blog/1782603