问题:
This question already has an answer here: 这个问题在这里已有答案:
- How do I revert a Git repository to a previous commit? 如何将Git存储库还原为先前的提交? 41 answers 41个答案
I cloned a Git repository and then tried to roll it back to a particular commit early on in the development process. 我克隆了一个Git存储库,然后尝试在开发过程的早期将其回滚到特定的提交。 Everything that was added to the repository after that point is unimportant to me so I want to omit all subsequent changes from my local source code. 在该点之后添加到存储库的所有内容对我来说都不重要,因此我想省略本地源代码中的所有后续更改。
However, when I try to roll back in the GUI tool it doesn't update my local file system - I always end up with the latest source code for the project. 但是,当我尝试回滚GUI工具时,它不会更新我的本地文件系统 - 我总是最终得到项目的最新源代码。
What's the correct way to just get the source for a repository as of a particular commit in the project's history and omit all later updates? 从项目历史中的特定提交中获取存储库的源代码的正确方法是什么,并省略所有后续更新?
解决方案:
参考一: https://stackoom.com/question/6mdx/如何将Git存储库回滚-重置-到特定的提交-重复参考二: https://oldbug.net/q/6mdx/How-do-you-roll-back-reset-a-Git-repository-to-a-particular-commit-duplicate
来源:oschina
链接:https://my.oschina.net/stackoom/blog/4261878