如何将文件重置或还原到特定版本?

牧云@^-^@ 提交于 2020-08-04 11:17:27

问题:

I have made some changes to a file which has been committed a few times as part of a group of files, but now want to reset/revert the changes on it back to a previous version. 我对文件进行了一些更改,该文件已作为一组文件的一部分提交了几次,但现在想将其更改重置/还原为以前的版本。

I have done a git log along with a git diff to find the revision I need, but just have no idea how to get the file back to its former state in the past. 我已经做了一个git log和一个git diff来找到我需要的修订,但是却不知道如何使文件回到过去的状态。


解决方案:

参考一: https://stackoom.com/question/u7K/如何将文件重置或还原到特定版本
参考二: https://oldbug.net/q/u7K/How-can-I-reset-or-revert-a-file-to-a-specific-revision
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!