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

Re: can git reset or checkout be reverted?

From
Jakub Narebski <jnareb@gmail.com>
Date
Feb 6, 2009, 14:47 UTC
Message-ID
<m3vdrnvczd.fsf@localhost.localdomain>
In-Reply-To
<20090206141940.GB7231@b2j>
bill lam <cbill.lam@gmail.com> writes:
Show 9 quoted lines
> If I want to recall a old version of testing by
> 
> git reset --hard sha1
> or
> git checkout sha1
> 
> then git log does not show anything beyond that commit. It does give
> some warning and recommend -b switch next time.  If I only do that by
> accident or ignorance.  How to revert to the original HEAD?
  git checkout ORIG_HEAD
or
  git checkout HEAD@{1}
You can check it out wrt. second form using "git reflog" ("git log -g").
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Matthieu MoyNext: Sitaram Chamarty
Message 3 of 5 in “can git reset or checkout be reverted?”
  1. bill lamFeb 6, 2009
  2. Matthieu MoyFeb 6, 2009
  3. Jakub NarebskiFeb 6, 2009
  4. Sitaram ChamartyFeb 6, 2009
  5. bill lamFeb 7, 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.