git 签出分支本地暂存代码丢失

push更新代码不成功,反而把本地代码弄丢

1.执行命令:

git reflog

发现是 【      HEAD@{2}: commit: 添加客户端、管理端、sql文件夹     】这里操作时把代码搞丢了

2.     执行命令:

git reset --hard HEAD@{2}

成功找回丢失文件

解决 Git 报 error unknown switch `e‘ 错误

花括号在 PowerShell 中被认为是代码块执行标识符,
若想正常使用,可用反引号 `` 进行转义
stash@`{0’}

 

参考路径:https://blog.csdn.net/qq_52351238/article/details/113574640

参考路径:https://blog.csdn.net/weixin_39581226/article/details/105406386

posted @ 2021-06-04 15:18  lzhflzjx  阅读(322)  评论(0编辑  收藏  举报