不小心git stash时,报错如下:
# git stash
warning: LF will be replaced by CRLF in 03-server/gb_server/sip_server/include/strategy.h.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in 03-server/gb_server/sip_server/source/strategy_manager.cpp.
The file will have its original line endings in your working directory.
Saved working directory and index state WIP on V2.1: f3f1a22b3 1. xxxx
Unlink of file '03-server/gb_server/sip_server/doc/sip_server代码阅读.docx' failed. Should I try again? (y/n) n
error: unable to unlink old '03-server/gb_server/sip_server/doc/sip_server代码阅读.docx': Invalid argument
fatal: Could not reset index file to revision 'HEAD'.
$ git stash pop (没有找回之前代码,崩溃)
git stash list
执行 git stash pop stash@{0}
找回来了,感谢下面这个链接
https://www.jianshu.com/p/a634af0eb343?from=singlemessage