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

Re: Reverting to old commit

From
DSDirk Süsserott <newsletter@dirk.my1.cc>
Date
May 27, 2008, 20:02 UTC
Message-ID
<483C68E5.1040408@dirk.my1.cc>
In-Reply-To
<8345bd80805271050q7412917bt292a276fbbe6aed3@mail.gmail.com>
Marcus schrieb:
Show 18 quoted lines
> Newbie question: What's the simplest way to find an old commit and revert?
>
> Say you have a version from yesterday which worked and today's
> experiments failed, so you want to go back to that working version.
> Unfortunately, it's not tagged. Instead you need to actually view the
> code to identify the version you want. I thought maybe gitk might
> help, but I can't find my way with gitk. I hoped you could browse
> revisions easier in a GUI and tell gitk or git-gui to revert?
>
> Thanks,
>
> Marcus
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>   

Probably I misunderstood, but: do you *know* which version worked well? I.e. when you start gitk, can you point to the working commit and are just wondering how to revert to that one?

Then gitk's "reset ... branch to here" could help you. Right-click the desired commit and reset the branch.

There's no need to have a tag for this. You can even create a tag afterwards for any commit you like. It's just an alias for the commit id (sha1).

If you cannot identify the working commit, then please forget my answer and follow the "git bisect" proposals.

Previous: Sverre RabbelierNext: Paolo Bonzini
Message 6 of 8 in “Reverting to old commit”
  1. MarcusMay 27, 2008
  2. Jakub NarebskiMay 27, 2008
  3. Brandon CaseyMay 27, 2008
  4. Sverre RabbelierMay 27, 2008
  5. Sverre RabbelierMay 27, 2008
  6. Dirk SüsserottMay 27, 2008
  7. Paolo BonziniMay 27, 2008
  8. Robin RosenbergMay 27, 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.