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

Re: About detached heads

From
Geoff Russell <geoffrey.russell@gmail.com>
Date
Mar 15, 2008, 02:03 UTC
Message-ID
<93c3eada0803141903p30184defk979247129a1cc6db@mail.gmail.com>
In-Reply-To
<alpine.LFD.1.00.0803142025080.2947@xanadu.home>
On 3/15/08, Nicolas Pitre <nico@cam.org> wrote:
Show 27 quoted lines
> ...
>
>         git reset --hard HEAD@{yesterday.at.4pm}
>
>  and it'll magically bring you back to the state you were yesterday at
>  4pm.  You need the 6pm state instead?  No problem: just ask for
>  yesterday.at.6pm then.
>
>  And before doing the 'reset --hard', you might want to do a simple
>  'checkout' beforehand so you can be sure it actually corresponds to what
>  you want:
>
>         git checkout HEAD@{yesterday.at.4pm}
>         [compile, test, whatever]
>         git checkout HEAD@{yesterday.at.6pm}
>         [compile, test, whatever]
>
>  and when OK with it, then:
>
>         # return to your master branch (or any other branch)
>         git checkout master
>         # then reset it to the desired state
>         git reset --hard HEAD@{yesterday.at.6pm}
>
>
>
>  Nicolas
More useful advice ... many thanks.

Cheers, Geoff.

Previous: Nicolas Pitre
Message 22 of 22 in “About detached heads”
  1. Geoff RussellMar 14, 2008
  2. Jonathan del StrotherMar 14, 2008
  3. David KågedalMar 14, 2008
  4. Wincent ColaiutaMar 14, 2008
  5. Matthieu MoyMar 14, 2008
  6. Wincent ColaiutaMar 14, 2008
  7. Jakub NarebskiMar 14, 2008
  8. Sergei OrganovMar 14, 2008
  9. Adam PiatyszekMar 14, 2008
  10. Chris ShoemakerMar 14, 2008
  11. Rafael Garcia-SuarezMar 14, 2008
  12. Nicolas PitreMar 14, 2008
  13. Jakub NarebskiMar 14, 2008
  14. Linus TorvaldsMar 14, 2008
  15. Björn SteinbrinkMar 14, 2008
  16. Linus TorvaldsMar 14, 2008
  17. Jakub NarebskiMar 14, 2008
  18. SeanMar 14, 2008
  19. Geoff RussellMar 14, 2008
  20. Jakub NarebskiMar 15, 2008
  21. Nicolas PitreMar 15, 2008
  22. Geoff RussellMar 15, 2008

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.