From: Junio C Hamano Date: Wed, 14 Feb 2007 19:50:08 GMT Subject: Re: Stupid question on getting branch from yesterday Message-ID: <7vbqjwo6xb.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <17875.25882.784307.731860@lisa.zopyra.com> Bill Lear writes: > 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 > > or would I do > > % git reset --soft > > or something else? Do you mean you have something like this: ---o---o---o---o---o---*---o---o HEAD ^ ^ two days lame ago and want to revert the lame one, or do you mean ---o---o---o---o---o---*---*---* HEAD ^ ^ ^ ^ two days lame ago all are lame after certain point and want to discard all of them? If the latter, probably "reset --hard ^" (i.e. the parent of the first lame one) is what you want. If the former, you may want to "git revert " or "git rebase --onto ^ ".