From: Jakub Narebski <jnareb@gmail.com>
To: bill lam <cbill.lam@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: can git reset or checkout be reverted?
Date: Fri, 06 Feb 2009 06:47:40 -0800 (PST) [thread overview]
Message-ID: <m3vdrnvczd.fsf@localhost.localdomain> (raw)
In-Reply-To: <20090206141940.GB7231@b2j>
bill lam <cbill.lam@gmail.com> writes:
> If I want to recall a old version of testing by
>
> git reset --hard sha1
> or
> git checkout sha1
>
> then git log does not show anything beyond that commit. It does give
> some warning and recommend -b switch next time. If I only do that by
> accident or ignorance. How to revert to the original HEAD?
git checkout ORIG_HEAD
or
git checkout HEAD@{1}
You can check it out wrt. second form using "git reflog" ("git log -g").
--
Jakub Narebski
Poland
ShadeHawk on #git
next prev parent reply other threads:[~2009-02-06 14:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-06 14:19 can git reset or checkout be reverted? bill lam
2009-02-06 14:43 ` Matthieu Moy
2009-02-06 14:47 ` Jakub Narebski [this message]
2009-02-06 16:03 ` Sitaram Chamarty
2009-02-07 5:31 ` bill lam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3vdrnvczd.fsf@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=cbill.lam@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).