Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 13
    This is the correct answer! Single line command to apply only stashed changes from specific files, works like a charm!
    – 4levels
    Commented Jun 20, 2014 at 13:23
  • 2
    To apply (just) the stashed changes for the file: "git diff stash@{N}^1 stash@{N} -- <filename> | git apply"
    – Vivek
    Commented Oct 13, 2016 at 7:19
  • This works for me too. Just selectively checkout the files needed to use from stash and you are done. I was stuck in this a I had used -a flag while creating the stash. Commented Oct 17, 2017 at 18:18
  • 1
    @4levels I think "apply stashed changes" is not what happens, right? I think "overwrite whatever you have with the copy from stash" is what happens.
    – msouth
    Commented Nov 5, 2019 at 16:51