X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=Documentation%2Fgit-stash.txt;h=fafe728f890d5020ffc5f1ab28deb4b3d02313a5;hb=b7eb912b0d3352d43a11c79fab97cd7f92f0646e;hp=30a249cbc5a5f45df88f9698b192e84b883faefa;hpb=3c2eb80fe3f3c7efbb25e929df9f70d7c896a5ef;p=git.git diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 30a249cbc..fafe728f8 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -78,7 +78,8 @@ stash@{1}: On master: 9cc0589... Add git-stash ---------------------------------------------------------------- + The command takes options applicable to the 'git-log' -command to control what is shown and how. See linkgit:git-log[1]. +command to control what is shown and how. If no options are set, the +default is `-n 10`. See linkgit:git-log[1]. show []:: @@ -126,7 +127,8 @@ no conflicts. clear:: Remove all the stashed states. Note that those states will then - be subject to pruning, and may be difficult or impossible to recover. + be subject to pruning, and may be impossible to recover (see + 'Examples' below for a possible strategy). drop [-q|--quiet] []:: @@ -229,6 +231,20 @@ $ edit/build/test remaining parts $ git commit foo -m 'Remaining parts' ---------------------------------------------------------------- +Recovering stashes that were cleared/dropped erroneously:: + +If you mistakenly drop or clear stashes, they cannot be recovered +through the normal safety mechanisms. However, you can try the +following incantation to get a list of stashes that are still in your +repository, but not reachable any more: ++ +---------------------------------------------------------------- +git fsck --unreachable | +grep commit | cut -d\ -f3 | +xargs git log --merges --no-walk --grep=WIP +---------------------------------------------------------------- + + SEE ALSO -------- linkgit:git-checkout[1],