问题:
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
来源:oschina
链接:https://my.oschina.net/u/3797416/blog/4450342