git 切换分支 本地代码失踪找回办法

解决方案:

https://blog.csdn.net/hupoling/article/details/79017382

主要步骤:

git reflog

然后找到之前commit的分支

git checkout  1234412(那个序号)   切换过来

git checkout -b xxxxxxx   (自己起名字)

git checkout master  切换过来

git merge  xxxxxxx   合并上去

git branch -d xxxxxxx   删掉临时分支

演示如下:

原文地址:https://www.cnblogs.com/xx123/p/14493143.html