在开发中,使用git stash 把文件暂存,使用git stash pop 恢复了文件。 但是不小心,reset 所有修改,这下git stash list 没有暂存的修改,写的代码没有了,找不回了,这可怎么办。
git:(master) ✗ git fsck
dangling commit 559b998d34b9ac91e88458c865c4dc3214aedf92
dangling 是挂起的未提交的点,这个就是你git stash drop 和git rest 摧毁的点。
查看未提交的内容
➜ git:(master) git show 559b998d34b9ac91e88458c865c4dc3214aedf92
恢复未提交的内容
➜ git:(master) git stash apply 559b998d34b9ac91e88458c865c4dc3214aedf92