Here's the situation : some commits have been done in a remote repository.
Unfortunately, someone did push -f
such that no remote branch references these commits anymore.
To make matters worse, I don't have those commits in my local clone.
My goal is basically to recover those commits. These are some of the things I tried :
git checkout -b recovery <commit_id>
: fatal: reference is not a treegit push origin <commit_id>:recovery
error: refs/heads/recovery does not point to a valid object! error: unable to push to unqualified destination: recovery The destination refspec neither matches an existing ref on the remote nor begins with refs/, and we are unable to guess a prefix based on the source ref.