Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在本地 Git 存储库中删除了一个文件。我希望通过更新我的 Git 存储库来恢复文件。
我运行以下失败
git pull
它说 upToDate,但我没有得到最新的文件。github上的public repo没有使用SVN,所以问题不可能是SVN。
如何更新本地 Git存储库,以便将删除的文件恢复到计算机?
如果尚未提交:
git checkout path/to/file
八月可能是解决您问题的最佳方法。
您还可以恢复到您提取的最后一个版本:
git reset --hard