My situation is: after I have changed a lot of things, I quickly submitted it, but I did ignore it. I didn't submit it under any branch at the time. When I finish submitting it, then I went to eclipse to check that all the code I changed was gone. I was particularly scared. My colleague said that I had to redo it, and I didn't give up. I went on to Baidu and found a friend who encountered the same problem as me. So I recovered the lost file.
The original text is as follows:
Because there is a conflict with the remote server, it is actually done on (no branch) when resolving the conflict.
After a period of modification, I suddenly forgot that I thought it was a change made in a certain Branch. I used git Co master and then checked it with GIT branch,
git branch* (no branch) master
git branch
* master
I was shocked. Many of the previous changes were lost, and there was only one master branch. Fortunately, it prompted no branch and other words. I searched Google and found that someone had encountered such a situation.
Http://serverfault.com/questions/56722/git-seemed-to-be-in-no-branch-and-then-lost-my-changes
The GIT reflog command in Ubuntu does not automatically complete it. Therefore, this record is required in a timely manner.
The solution is shown in the preceding link:
Git reflog
You can check which version is the version you want to restore.
Then:
Git checkout ca2deraf (just an example)
It is better to use git checkout-B backup again
Back it up
The link is as follows:
Http://blog.csdn.net/jingwenlai_scut/article/details/5476967
Because there is a conflict with the remote server, it is actually done on (no branch) when resolving the conflict.
After a period of modification, I suddenly forgot that I thought it was a change made in a certain Branch. I used git Co master and then checked it with GIT branch,
git branch* (no branch) master
git branch
* master
I was shocked. Many of the previous changes were lost, and there was only one master branch. Fortunately, it prompted no branch and other words. I searched Google and found that someone had encountered such a situation.
Http://serverfault.com/questions/56722/git-seemed-to-be-in-no-branch-and-then-lost-my-changes
The GIT reflog command in Ubuntu does not automatically complete it. Therefore, this record is required in a timely manner.
The solution is shown in the preceding link:
Git reflog
You can check which version is the version you want to restore.
Then:
Git checkout ca2deraf (just an example)
It is better to use git checkout-B backup again
Back it up