"There are currently no branches" after committing

I checked for an earlier commit:

git checkout 12345

Then go back to the last commit:

git checkout 56789

And then he continued to do, and I:

There are currently no branches.

Perhaps I should have done:

git checkout master

After the first check, instead of specifying a commit identifier.

However, any idea how to get my last commits to the master branch (which is a few delays)?

thank

+5
source share
2 answers

When you execute git checkout 12345, you will not have a branch state. Do not do that. This is intended to test validation, not work in it.

, reset , , , git reset 12345 ( --hard). , git checkout -b <name> <sha1> .

, , , git checkout master

, 56789, 56789, :

git reset <commit_over_56789>
+10

, (56789), .

, :

git branch -f master 56789

reset , commit. git checkout master , .

+4

All Articles