From: Jari Aalto <redacted>
Add new example "Saving selected files to stash" thanks to
ideas by Johan Sageryd [off-list ref].
Signed-off-by: Jari Aalto <redacted>
---
Documentation/git-stash.txt | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index 473889a..7d9f9e1 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -230,6 +230,18 @@ $ edit/build/test remaining parts
$ git commit foo -m 'Remaining parts'
----------------------------------------------------------------
+Saving selected files to stash::
+
+You can use `git stash save --keep-index` to put only selected files
+into the stash. Let's suppose the files A, B, C and D are modified and
+you want to stash only C and D:
++
+----------------------------------------------------------------
+$ git status # Verify what's modified
+$ git add A B # ...not these
+$ git stash save --keep-index # ...but stash all the others
+----------------------------------------------------------------
+
Recovering stashes that were cleared/dropped erroneously::
If you mistakenly drop or clear stashes, they cannot be recovered
--
1.7.0