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

Re: Problem getting older version

From
Junio C Hamano <junkio@cox.net>
Date
Oct 19, 2005, 08:26 UTC
Message-ID
<7vach5ewu4.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20051019080046.GI22986@schottelius.org>
Nico -telmich- Schottelius <nico-linux-git@schottelius.org> writes:
> The following situation:
>
> - The last commit was a merge, mhich broke some files
> - We want three files from the commit before

With only git-core tool, with the tip of the master branch, would be:

    $ git pull somewhere ;# this caused the mismerge
    $ git checkout HEAD^ foo.c bar.c baz.c

This assumes that HEAD is a merge and HEAD^ (= HEAD^1) is the tip of your branch before that merge (HEAD^2 would be what you pulled from "somewhere").

The latest "git checkout", when given extra paths parameters, does not switch branches. Instead it pulls out named files from the given version into your index, and checks them out.

> Now I was told to do the following:

These 5 steps look correct; after that, you probably would want to run git-update-index on those three paths.

Previous: Nico -telmich- SchotteliusNext: Petr Baudis
Message 2 of 4 in “Problem getting older version”
  1. Nico -telmich- SchotteliusOct 19, 2005
  2. Junio C HamanoOct 19, 2005
  3. Petr BaudisOct 20, 2005
  4. Nico -telmich- SchotteliusOct 24, 2005

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.