Thread (1 message) 1 message, 1 author, 2016-06-15

Re: Stupid question on getting branch from yesterday

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:54

"Shawn O. Pearce" [off-list ref] writes:
Bill Lear [off-list ref] wrote:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help