-
-
Save alx-developer/da90f802ba28b195f0fd76b2c8cca677 to your computer and use it in GitHub Desktop.
Revisions
-
joseluisq revised this gist
Jul 22, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,4 +22,4 @@ __Source:__ View the complete answer at https://stackoverflow.com/a/91795/251059 ## Bonus If you are [Fish shell](https://fishshell.com/) user, you can take a look at [GitNow](https://github.com/joseluisq/gitnow) which is a tool to perform faster Git operations and that can also stash your changes for you. -
joseluisq revised this gist
Jul 22, 2020 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,14 +8,18 @@ git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling com _This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph._ __bash/sh shell users:__ Version above is for [Fish shell](https://fishshell.com/), so if you are Bash/SH user just add a `$` sign before to the left parenthesis. ## 2. Once you know the hash of the commit you want, you can apply it as a stash ```sh git stash apply YOUR_WIP_COMMIT_HASH_HERE ``` _**Note:** The commit message will only be in this form (starting with "WIP on") if you did not supply a message when you did git stash._ __Source:__ View the complete answer at https://stackoverflow.com/a/91795/2510591 ## Bonus If you are [Fish shell](https://fishshell.com/) user, you can take a look [GitNow](https://github.com/joseluisq/gitnow) which is a tool to perform faster Git operations and that can also stash your changes for you. -
joseluisq revised this gist
Oct 11, 2019 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,16 @@ # How to recover a dropped stash in Git? ## 1. Find the stash commits ```sh git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' ) ``` _This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph._ __bash/sh shell users:__ Version above is for Fish shell, so if you are bash/sh user just add a `$` sign before to the left parenthesis. ## 2. Once you know the hash of the commit you want, you can apply it as a stash ```sh git stash apply YOUR_WIP_COMMIT_HASH -
joseluisq revised this gist
Feb 2, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,14 @@ # How to recover a dropped stash in Git? __1. Find the stash commits:__ ```sh git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' ) ``` _This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph._ __2. Once you know the hash of the commit you want, you can apply it as a stash:__ ```sh git stash apply YOUR_WIP_COMMIT_HASH -
joseluisq created this gist
Feb 2, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ # How to recover a dropped stash in Git? 1. Find the stash commits: ```sh git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' ) ``` _This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph._ 2. Once you know the hash of the commit you want, you can apply it as a stash: ```sh git stash apply YOUR_WIP_COMMIT_HASH ``` _Note: The commit message will only be in this form (starting with "WIP on") if you did not supply a message when you did git stash._ __Source:__ View the complete answer at https://stackoverflow.com/a/91795/2510591