Re: Stupid question on getting branch from yesterday
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Feb 14, 2007, 19:49 UTC
- Message-ID
- <20070214194919.GE28290@spearce.org>
- In-Reply-To
- <17875.25882.784307.731860@lisa.zopyra.com>
Bill Lear <rael@zopyra.com> wrote:
Show 11 quoted lines
> 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`.
-- Shawn.