我从 git 中删除了一些文件,现在想要它们回来。我正在尝试使用git checkout来恢复文件。
我回顾了我的历史,并确定了文件被删除的提交。当我跑步时git checkout <sha of deleting commit> path/to/my/file,我得到
error: pathspec 'path/to/my/file' did not match any file(s) known to git.
我究竟做错了什么?
多。删除这些文件的提交必然不再拥有它们。因此,我需要进一步提交一次。跑步:
git checkout <sha of deleting commit>^ path/to/my/file
完美运行
| 归档时间: |
|
| 查看次数: |
1584 次 |
| 最近记录: |