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.

Required fields*

3
  • 2
    stackoverflow.com/a/19700341/1668622 is much shorter than the accepted answer, does not need any additional tools (like e.g. JesusFreke's script) and it only stashes, what you wanted to stash Commented Sep 8, 2015 at 9:45
  • 14
    >>>>>>>>> git diff -- *filename* > ~/patch then git checkout -- *filename* and later you can re-apply the patch with git apply ~/patch Commented Dec 23, 2015 at 2:08
  • 91
    Most existing answers below are outdated. Since Git 2.13 (Q2 2017) it is supported with git stash push [--] [<pathspec>...]. Commented Aug 15, 2017 at 13:23