首先,我们当使用git stash drop和git stash pop时候,git stash list是看上去不可见了,但是实质上git并没有删除这个文件,就是你的引用关系被移除了,你需要去搜索那条对应被丢弃的commit下的代码。

git stash drop stash@

误删除操作的提交ID=d913390d80e5feea2e3b453c4ca62b87528e9d2d

显示出所有不可访问的对象

git fsck --lost-found

恢复(git stash apply 指定id)

git stash apply d913390d80e5feea2e3b453c4ca62b87528e9d2d

参考博客

https://developer.aliyun.com/article/1114802

posted on 2023-10-17 11:35  哑吧  阅读(273)  评论(0)    收藏  举报