Restore a remote branch after a `git fetch --prune`

51 Views Asked by At

I ran git fetch --prune and I see:

- [deleted] (none) -> origin/branch_name_here

I can not tell from the branch name if it was an important reference.

How do I find out where origin/branch_name_here was pointing?

It has not been used in a long time and so it is not listed in git reflog, and either way I do not know the commit message associated with origin/branch_name_here.

I have run git config --local gc.auto 0 to disable garbage collection in order to prevent losing the commits.

git fsck --full --no-reflogs  | cut -d' ' -f3 | xargs -P2 git log --oneline | grep 'branch_name_here'

shows nothing because branch_name_here is not part of the commit message.

looking through .git/objects/?? and sorting by file modification/creation date would take forever.

I suspect the answer is the same with respect to pruned tags... no.

0

There are 0 best solutions below