Skip to content

Instantly share code, notes, and snippets.

View cumanacr's full-sized avatar

Cristian Umaña cumanacr

  • Costa Rica
  • 21:39 (UTC -06:00)
View GitHub Profile
@cumanacr
cumanacr / stash_dropped.md
Created April 29, 2021 00:19 — 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.