Andrea2333
Andrea2333

Reputation: 25

How to undo git checkout -B branch?

I have some old changes in one branch but this command has reset the branch to my master and cannot be undone by reflog. What should I do?

Log:

$ git checkout -B branch
Switched to and reset branch 'branch'

Upvotes: 1

Views: 216

Answers (1)

Andrea2333
Andrea2333

Reputation: 25

Answer to my own question: I managed to find my change back not by reseting the checkout, but by reseting to the old change in the reflog history a while ago. Lucky for me it was still there.

Upvotes: 1

Related Questions