What's the command to reset a file to a specific commit?
This question already has an answer here:
Mind your terminology. With git "reset" refers to setting a ref (eg branch) to a new commit. You want to put a file from some commit into your working copy. Exactly this is a "checkout".
You can checkout all files of a commit with
git checkout commit
or only part of the commit with
git checkout commit file
If you only want to "show" a file of some commit without changing your working copy you can also use
git show commit:file
链接地址: http://www.djcxy.com/p/18824.html
上一篇: 从本地删除不需要的文件并反向提交/合并
下一篇: 将文件重置为特定提交的命令是什么?