1

Something mysterious happened and the local git branch I was working on disappeared. I have no idea where it went.

Is there any way to list all commits that have ever been made across all branches, even ones that aren't around any more?

QuinnFreedman
  • 2,242
  • 2
  • 25
  • 42
  • 'git reflog' should give the HEAD history, then you can checkout to specific commit that might be listed there. – hurturk Mar 19 '17 at 19:50
  • @zatta git reflog doesn't show any commits since I branched – QuinnFreedman Mar 19 '17 at 19:55
  • Afaik, reflog is global and at least should show you commits you made recently. Are you sure you are in the correct project directory locally? More verbose command would be `git reflog --all` – hurturk Mar 19 '17 at 21:00

1 Answers1

0

git reflog doesn't show any commits since I branched

That means you might not have committed sonce you have branched.
Maybe your files were added to the index but were since removed from disk?
As seen in this guide (or in "Recover from git reset --hard?"), check the result of:

git fsck −−lost-found

(more complete command: git fsck --full --unreachable --no-reflog)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250