Skip to main content

Timeline for How to unstash only certain files?

Current License: CC BY-SA 4.0

6 events
when toggle format what by license comment
Apr 16, 2021 at 15:34 comment added Alwyn Schoeman The ^! did not work in my case, so I ended up doing git diff stash@{N} -- path/to/file | git apply -R
Aug 20, 2020 at 11:07 comment added kxr diff stash@{N}^! already produces a forward diff, so omit -R
Jan 23, 2020 at 22:41 comment added John Mee "patch failed"? Try a 3-way merge. ...| git apply -3 -
Jan 15, 2020 at 15:36 comment added ThomasH I'm not getting the path/to/file2 as the you want to diff against the same file in your workspace. Leaving out the second path works fine for me. - And I get an error message using the -R option ("apply the patch in reverse", trying to patch the stashed version?!). So my working version looks like git diff stash@{N}^! -- path/to/file | git apply - .
Dec 8, 2019 at 0:21 comment added cambunctious This is the only correct answer IMO. Using checkout or show will blindly overwrite your file instead of just applying changes. "One more way" is an understatement.
May 16, 2018 at 12:12 history answered LachoTomov CC BY-SA 4.0