Answer the question
In order to leave comments, you need to log in
How to restore commits from an unnamed branch?
Good evening!
I am using SourceTree.
I made a commit in develop. Then I did something in a hurry (This is my big mistake), which led to the creation of a branch that was unnamed, but on which there was HEAD. For several days I wrote changes (commits) to this unnamed branch.
And so I decided to switch to the develop branch. And damn it, the unnamed branch was gone, I ended up on the develop branch, my changes were lost.
The deadline is already on Monday, and here it is !!!
Can you please tell me how can I revert my changes from an unnamed branch?
Answer the question
In order to leave comments, you need to log in
Through git reflog
looking for hashes of lost commits.
reflog displays all hashes where HEAD was.
And then:
Well, then go to develop (although you seem to be there anyway) and merge the lost changes:
git checkout develop
git merge new-branch-name
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question