Recover deleted stash in Git

If you had accidentally deleted a stash in Git and you want to retrieve the changes and auto merge the files that has been updated in your master, you can type this line in your terminal:

git fsck --unreachable

look for the lines which have “unreachable commit”. When you had found the commit of the stash you are looking for, just apply the stash again with the SHA hash of the commit.

git stash apply REPLACE_WITH_COMMIT_SHA

you can now see the changes for commit of the stash in your working copy, proceed as normal.