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.

3
  • 4
    This might be what you want in some cases, but beware that this command will overwrite rather than merge with any working directory changes.
    – Rhubbarb
    Commented Nov 5, 2015 at 12:06
  • This works for me, since I just wanted to copy a file that exists only in the stash and didn't care to checkout anything. Commented Oct 26, 2016 at 5:33
  • 1
    For Windows PowerShell: git show stash@`{0`}:Path/To/MyFile.txt |sc Path/To/MyFile.txt - the backticks are necessary for PS to not interpret the braces specially, and the sc is necessary because PS's > operator defaults to UTF-16 (actually UCS-2) which is probably not what you want. @Balamurugan A's answer doesn't suffer from these issues.
    – Ian Kemp
    Commented Jun 9, 2017 at 6:48