git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* how do i revert to a previous version, keeping the history
@ 2008-04-02  6:50 Ittay Dror
  2008-04-02  6:57 ` Johannes Sixt
  2008-04-02  7:12 ` Junio C Hamano
  0 siblings, 2 replies; 3+ messages in thread
From: Ittay Dror @ 2008-04-02  6:50 UTC (permalink / raw)
  To: git

Hi,

I have this revision history: A-B
I want to go back to the code in A, but keep B in the history: A-B-A

How do I do that?

Thank you,
Ittay

-- 
Ittay Dror <ittayd@tikalk.com>
Tikal <http://www.tikalk.com>
Tikal Project <http://tikal.sourceforge.net>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how do i revert to a previous version, keeping the history
  2008-04-02  6:50 how do i revert to a previous version, keeping the history Ittay Dror
@ 2008-04-02  6:57 ` Johannes Sixt
  2008-04-02  7:12 ` Junio C Hamano
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Sixt @ 2008-04-02  6:57 UTC (permalink / raw)
  To: Ittay Dror; +Cc: git

Ittay Dror schrieb:
> I have this revision history: A-B
> I want to go back to the code in A, but keep B in the history: A-B-A
> 
> How do I do that?

git revert HEAD

-- Hannes

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how do i revert to a previous version, keeping the history
  2008-04-02  6:50 how do i revert to a previous version, keeping the history Ittay Dror
  2008-04-02  6:57 ` Johannes Sixt
@ 2008-04-02  7:12 ` Junio C Hamano
  1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2008-04-02  7:12 UTC (permalink / raw)
  To: Ittay Dror; +Cc: git

Ittay Dror <ittayd@tikalk.com> writes:

> I have this revision history: A-B
> I want to go back to the code in A, but keep B in the history: A-B-A
>
> How do I do that?

Straight answer (iow, what you asked, which may not match what you wanted
to really do):

	$ git read-tree -m -u A
        $ git commit -m 'Revert to A'

Probably a more useful answer, guessing what you really wanted to do:

You have a botched commit F that was in the sequence of longer commits,
A--B--C--D--E--F--G--H, and you want to recover from the mistake F made
(iow, the change between E and F is bad):

	$ git revert F

This will make your history A--B--C--D--E--F--G--H--F' where the
difference between H and F' counteracts what F did relative to E.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-04-02  7:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-02  6:50 how do i revert to a previous version, keeping the history Ittay Dror
2008-04-02  6:57 ` Johannes Sixt
2008-04-02  7:12 ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).