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

Re: Git reset -p on working tree

From
knittl <knittl89@googlemail.com>
Date
Nov 23, 2010, 09:20 UTC
Message-ID
<AANLkTimP9zr=wQDYeBxtvYCE1mZ1aHXQ_nLOxGFfR9YD@mail.gmail.com>
In-Reply-To
<AANLkTimc=Dt9YSu=J=7C-f1hZ9UODU7VHu6oD8dmFX3N@mail.gmail.com>
On Tue, Nov 23, 2010 at 10:11 AM, Jeenu V <jeenuv@gmail.com> wrote:
Show 9 quoted lines
> Often I find it useful to selectively undo the modifications that I
> did to my working tree. The -p option to 'reset' that selectively
> resets changes back to a given commit. Unfortunately the option
> reports itself to be incompatible with --{hard,soft,mixed} and thus
> can't be applied to working tree.
>
> Right now I do this with vimdiff, by applying 'git diff' in reverse.
> Wish reset supports -p on working tree operations as well because the
> -p framework (of add, and reset) feels good to use.

there's `git checkout -p` to selectively remove changes from your working tree. (also `git stash -p` to selectively stash changes temporarily)

`git reset -p` will only undo staged changes from your index
-- 
typed with http://neo-layout.org
myFtPhp -- visit http://myftphp.sf.net -- v. 0.4.7 released!
Previous: Jeenu VNext: Jeenu V
Message 2 of 14 in “Git reset -p on working tree”
  1. Jeenu VNov 23, 2010
  2. knittlNov 23, 2010
  3. Jeenu VNov 23, 2010
  4. Jeenu VNov 23, 2010
  5. knittlNov 23, 2010
  6. Jeenu VNov 23, 2010
  7. Hint at "checkout -p" in the "reset --patch <type>" error messageŠtěpán Němec, Nov 23, 2010
  8. Jeff KingNov 23, 2010
  9. Štěpán NěmecNov 23, 2010
  10. Michael J GruberNov 25, 2010
  11. Jakub NarebskiNov 25, 2010
  12. Michael J GruberNov 25, 2010
  13. Matthieu MoyNov 25, 2010
  14. Jeff KingNov 25, 2010

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.