From: Avery Pennarun <apenwarr@gmail.com>
To: Mihamina Rakotomandimby <mihamina@gulfsat.mg>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: reverting vs resetting
Date: Fri, 5 Feb 2010 01:48:07 -0500 [thread overview]
Message-ID: <32541b131002042248x5461d904r276b184533ac492a@mail.gmail.com> (raw)
In-Reply-To: <20100205091223.6b4cffb1@pbmiha.malagasy.com>
On Fri, Feb 5, 2010 at 1:12 AM, Mihamina Rakotomandimby
<mihamina@gulfsat.mg> wrote:
> When we decided to giveup, we decided to get back to the configuration
> before Bob broke it. But it would be interesting to see Andy's history.
>
> Reverting or resetting?
Try this:
git checkout HEAD~5 .
git commit -m "reverted back to the version before this mess"
Replace HEAD~5 with the revision you want it to look like. But don't
forget the "." in the checkout line! All the magic is in there. When
you specify a path ("."), git won't change the revision HEAD points
to, but it will change all the files and the index to the ones from
the specified version. Then you can commit these files, producing
effectively a single commit that undoes a bunch of previous ones.
Have fun,
Avery
next prev parent reply other threads:[~2010-02-05 10:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-05 6:12 reverting vs resetting Mihamina Rakotomandimby
2010-02-05 6:48 ` Avery Pennarun [this message]
2010-02-05 7:09 ` Junio C Hamano
2010-02-05 8:41 ` Matthieu Moy
2010-02-05 11:21 ` Mihamina Rakotomandimby
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=32541b131002042248x5461d904r276b184533ac492a@mail.gmail.com \
--to=apenwarr@gmail.com \
--cc=git@vger.kernel.org \
--cc=mihamina@gulfsat.mg \
/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).