Re: Git in a Nutshell guide
- From
Matthieu Moy <matthieu.moy@imag.fr>
- Date
- Nov 19, 2007, 17:05 UTC
- Message-ID
- <vpqejemtbc3.fsf@bauges.imag.fr>
- In-Reply-To
- <E983072E-E9FD-499E-A418-B630A275C4F3@lrde.epita.fr>
Benoit Sigoure <tsuna@lrde.epita.fr> writes:
> git reset --hard HEAD~42 and then git reset --hard A.
And if you don't "remember" A, the reflog is here for you.
$ git reflog show HEAD
$ git reset --hard HEAD@{42} # not "the 42th ancestor"
# but "where HEAD was 42 moves ago".By default, the reflog will expire after IIRC, 3 months, and git-prune will not prune the objects while they are reachable.
So, it's even safer than you say ;-).
-- Matthieu