Fix git "not currently in any branch" after merge conflicts

I tried to commit the changes. After many problems and conflicts, I managed to solve every problem. However, the code I executed is currently not in any branch (as shown git status). How can I fix this problem? I tried several solutions, but no one worked for me. I tried the team git merge, but it says that it is already updated.

Update

The result git log --all --graph --oneline --decorateis:

* 7833c31 (HEAD) Changed LI tool
* c205a25 Fixed merge conflicts
*   7b10e48 (vsproj/master, master) 4-7-2013
|\  
| * cc51cb0 3/9/2013
| * 62ea718 Updated mail and added barcode
| * 9a3573a 1-7-2013
| * 96ded0e Updated ExamsPrinter
| * be6638a 12-25-2012
| * 89cba4b Added HTML to PDF and updated Email app
| * fa96aeb Updates
| * 9ffcfcc Changes in CloudDownloader, LinkedIn & Twitter apps
| * 609c555 Added README file
| * bf8a344 Started implementing CloudDownloader, created FileDownloader, updated FacebookInfoBot
| * c3556ce First Commit
* 3a59cd5 4-7-2013
+5
source share
3 answers

Not sure what happened, but you can easily fix it by creating a new branch and then changing it:

git branch lost_changes
git checkout master
git merge lost_changes
+9
source

, , . ,

*   7b10e48 (vsproj/master, master) 4-7-2013

, % 1,

* c205a25 Fixed merge conflicts

* 7833c31 (HEAD) Changed LI tool

,

git checkout -B master HEAD

.

? git, ( git add ), .

% 1: "" checkout ref git checkout HEAD@{1}, , git , , , .

+2

, :

git branch <name> 7833c31

git branch <name> HEAD

, , .

0
source

All Articles