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
  • 3
    You could also restash unstaged changes but keep the index. Commented Mar 4, 2013 at 23:18
  • ^ Yes. @R0MANARMY suggests a good approach. Use git stash --keep-index to do this. Commented Sep 21, 2018 at 15:02
  • After doing this, I realized I wanted to follow Dmitry's answer because I wanted to have my undesired changes still stashed, but my to-be-commited changes both in the working directory and index/cache/stage so that I could test them before committing them. Commented Jul 24, 2019 at 20:35