StackOverflow 文件 Git 教程 恢復 提交後恢復已刪除的檔案 提交後恢復已刪除的檔案 Created: November-22, 2018 如果你不小心提交了一個檔案刪除,後來意識到你需要它。 首先找到刪除檔案的提交的提交 ID。 placeholderCopygit log --diff-filter=D --summary將為你提供已刪除檔案的提交的已排序摘要。 然後繼續通過恢復檔案 placeholderCopygit checkout 81eeccf~1 <your-lost-file-name>(將 81eeccf 替換為你自己的提交 ID) 將檔案還原到以前的版本從丟失的提交中恢復