git rm 之后的文件如何還原


使用git stash.

 

1. 假定項目中有一個文件刪除之

git rm README.rdoc

 

2. 執行

git status

 顯示:

Saved working directory and index state WIP on master: bfcdf14 test git
HEAD is now at bfcdf14 test git

 3. 使用 git stash list

$ git stash list
stash@{0}: WIP on master: bfcdf14 test git

 

4. 拿出來使用 git stash pop

git stash pop

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM