git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Set the repository as it was on an earlier commit

From
Steven Noonan <steven@uplinklabs.net>
Date
Dec 25, 2009, 23:24 UTC
Message-ID
<f488382f0912251524i12bf53a4xf381606705abff4b@mail.gmail.com>
In-Reply-To
<8c6f7f450912251509i67da4665t78be0bb79f2c40d6@mail.gmail.com>
On Fri, Dec 25, 2009 at 3:09 PM, Sergio Belkin <sebelk@gmail.com> wrote:
Show 23 quoted lines
> Hi,
>
> Firstly merry Christmas everyone.
>
> I am somewhat new to git, and I've found great, but still I have some
> doubts about it, let's say I have the following repo with:
>
> A---B---C---D
>
> Being A the first commit,  B the second one an D the last one.
>
> How I do to go back to let's say... B commit status, I mean somewhat as follows:
>
> A---B---C---D---B'
>
> B' would be the same as B. I am not asking to do something so:
>
> A---B---C---D to A---B losing C and D commits,
>
> I'd like to keep on history C and D commits, can git to do that?
>
> Thanks in advance!
>

git revert D git revert C

Maybe? It would create two revert commits, but it would get you back to the state of B.

- Steven
Previous: Sergio BelkinNext: Santi Béjar
Message 2 of 6 in “Set the repository as it was on an earlier commit”
  1. Sergio BelkinDec 25, 2009
  2. Steven NoonanDec 25, 2009
  3. Santi BéjarDec 25, 2009
  4. Matthieu MoyDec 26, 2009
  5. Sergio BelkinDec 28, 2009
  6. Fwd: Set the repository as it was on an earlier commitSergio Belkin, Dec 28, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.