git/list[1] front-page[2] threads[3] people[4] search[5] about
 

checkout to a reflog entry

From
BLbill lam <cbill.lam@gmail.com>
Date
Aug 25, 2009, 04:52 UTC
Message-ID
<20090825045235.GB391@debian.b2j>
Sometimes when git reflog and try to checkout to a previous commit, 

project((6a33dbc...))$ git reflog show master 77aa688 master@{0}: rebase -i (finish): refs/heads/master onto fc3eaa4 6a33dbc master@{1}: commit: wip .....

project(master)$ git checkout master@{1}
Note: moving to 'master@{1}' which isn't a local branch
If you want to create a new branch from this checkout, you may do so
(now or later) by using -b with the checkout command again. Example:
  git checkout -b <new_branch_name>
HEAD is now at 6a33dbc... wip
project((6a33dbc...))$ 
project((6a33dbc...))$ git branch
* (no branch)
  master

It becomes (no branch) although the SHA1 is correct. If I then checkout master, then it revert and jump back up the previous master HEAD. I tried HEAD@{xx} also failed. What is the correct way of to checkout that master@{..} and stay in that master branch? (Sometimes it worked I forgot how and why)

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
Next: Jeff King
Message 1 of 3 in “checkout to a reflog entry”
  1. bill lamAug 25, 2009
  2. Jeff KingAug 25, 2009
  3. bill lamAug 25, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.