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

Re: Revert a single commit in a single file

From
Dario Rodriguez <soft.d4rio@gmail.com>
Date
Feb 25, 2011, 15:19 UTC
Message-ID
<AANLkTi=VJpTpAiLXohDi19ZsZVs5RP3s61DyoriCJnaa@mail.gmail.com>
In-Reply-To
<AANLkTikb_mWdgF4gf6FEBF=CLxLeefJJkRgDzEB5=3SO@mail.gmail.com>

Michael, my comment was about "reverting the changes from the old commit, but only for specified path/file", sorry about non quoting it.

I think that ''the old commit" is HEAD~1, so reverting it is about checking out HEAD~2, and commiting the results. The same is for a given file.

On Fri, Feb 25, 2011 at 11:38 AM, Thomas Ferris Nicolaisen <tfnico@gmail.com> wrote:

> Dario: Yes, I understand the reasoning. It's not often a problem, and
> when it occurs there are ways to do it. I just thought I'd bring it up
> on the list cause it feels like expected behavior (other git commands
> behave correspondingly).
Yeah, and may be your reasoning is better for the principle of least surprise.

Cheers, Dario

Previous: Thomas Ferris NicolaisenNext: Junio C Hamano
Message 7 of 13 in “Revert a single commit in a single file”
  1. Thomas Ferris NicolaisenFeb 25, 2011
  2. Ævar Arnfjörð BjarmasonFeb 25, 2011
  3. Michael J GruberFeb 25, 2011
  4. Dario RodriguezFeb 25, 2011
  5. Michael J GruberFeb 25, 2011
  6. Thomas Ferris NicolaisenFeb 25, 2011
  7. Dario RodriguezFeb 25, 2011
  8. Junio C HamanoFeb 25, 2011
  9. Ævar Arnfjörð BjarmasonFeb 25, 2011
  10. Junio C HamanoFeb 25, 2011
  11. Ævar Arnfjörð BjarmasonFeb 25, 2011
  12. Jay SoffianFeb 25, 2011
  13. Dario RodriguezFeb 26, 2011

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.