Skip to content

Instantly share code, notes, and snippets.

View felipelalli's full-sized avatar
👻
boo

Felipe Mica felipelalli

👻
boo
View GitHub Profile
@felipelalli
felipelalli / stash_dropped.md
Last active May 28, 2020 04:12 — 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.