git - After reverting to an old commit, I can't go back to the most recent commit -
i reverted repo old commit, see if bug happens there.
i thought did with:
git checkout the_rev_number .
but judging what's happening, may have forgot period @ end.
now git log
shows same rev (as 1 reverted to) beginning (topmost item) of log.
i tried git checkout .
revert recent commit, nothing changed. tried git reset --hard head
, again, nothing changed.
another clue: may have done initial revert while in subdir, tried recent commit while in repo root.
what should do?
when did:
git checkout <sha-1>
you checked out previous commit in detached head state. there nothing wrong whatsoever if want poke around.
when want return head of same branch, fix surprisingly simple. checkout branch again:
git checkout your_branch
in general, don't need worry did in detached head state.
Comments
Post a Comment