Skip to content

Instantly share code, notes, and snippets.

View suniladhya's full-sized avatar
🎯
Focusing

Sunil Adhya suniladhya

🎯
Focusing
View GitHub Profile
@suniladhya
suniladhya / stash_dropped.md
Created January 6, 2020 14:09 — forked from joseluisq/stash_dropped.md
How to recover a dropped stash in Git?

How to recover a dropped stash in Git?

1. Find the stash commits

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.

@suniladhya
suniladhya / stash_dropped.md
Last active January 6, 2020 14:09 — forked from joseluisq/stash_dropped.md
How to recover a dropped stash in Git?

How to recover a dropped stash in Git?

1. Find the stash commits

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.