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

Re: Stupid question on getting branch from yesterday

From
Junio C Hamano <junkio@cox.net>
Date
Feb 14, 2007, 19:54 UTC
Message-ID
<7v7iuko6qp.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20070214194919.GE28290@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 19 quoted lines
> Bill Lear <rael@zopyra.com> wrote:
>> I have not yet figured this one out: I have not tagged anything, but
>> know that I checked in something lame sometime between now and two days
>> ago.  How do I get my working repo to be that as it was, say, yesterday?
>> 
>> Do I do:
>> 
>> % git log --since="2 days ago"
>> 
>> parse, the output for the commit I want, and then do
>> 
>> % git reset <SHA>
>
> No.  This would update your branch and your index to <SHA>, but
> leave your working directory alone.  That's not what you want here.
>
> Use `git checkout <SHA>` which will detach your HEAD and seek to
> the commit, leaving your current commit alone.  Later you can get
> back by `git checkout oldbranch`.

Ah, I thought Bill was talking about getting rid of lame one, but now when I re-read his message, I think he is talking about going there to take a look, not necessarily wanting to discard or alter history.

Sorry, Bill, if that is the case, forget what I said about reset/revert/rebase in the other message.

Previous: Shawn O. PearceNext: Bill Lear
Message 3 of 9 in “Stupid question on getting branch from yesterday”
  1. Bill LearFeb 14, 2007
  2. Shawn O. PearceFeb 14, 2007
  3. Junio C HamanoFeb 14, 2007
  4. Bill LearFeb 14, 2007
  5. Bill LearFeb 14, 2007
  6. Jeff KingFeb 14, 2007
  7. Junio C HamanoFeb 14, 2007
  8. Linus TorvaldsFeb 14, 2007
  9. Junio C HamanoFeb 14, 2007

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.