I (a long time ago) deleted a branch via the BitBucket Cloud Web page / app.
A remote team member (junior / new developer-in-training) was on leave - but now is back and has been committing and pushing code changes to the deleted branch.
(They do not have the skills / code / project oversight to do the merging.
I did think that I would just get them to switch to the new branch and merge in all their changes into it. But this is beyond their current skillset)
So I need to be able to checkout the remote branch to my machine, so that I can do the required merge(s) to get the new "main" brain up to date with his changes.
I have the remote path and the SHA of the last commit he pushed and tried the following;
get fetch
git checkout -b origin/theDeletedPath <the commitSHA>
But I get an error that I can't resolve:
fatal: reference is not a tree: <the commitSHA>
The branch I want to recover does not appear in BitBucket Cloud (I have ensured that I am looking for ALL branches - not just active.
I have tried;
git branch -a -v
The latest commit/push to the deleted branch (unsurprisingly) does NOT appear in the commits for the repo, either.
I'd really appreciate any thoughts you might have.
Thanks!