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