Someone has accidentally deleted alpha branch in my team.
I have remote branch origin/alpha. I am not able to find this origin/alpha branch using git ls-remote.
I know last I did commit was XYZ on origin/alpha branch. I have SHA of that branch.
I am trying to create a new branch using this SHA. I used git checkout 45430f8834b0ebda6e89668cc4a4ba3f6a2067a4.
after that I tried to check out new branch using git checkout -b [NEW_BRANCH]
I am trying to git pull this branch. but I am getting below error
There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull <remote> <branch> If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/<branch> alpha_recovered Any idea how can I recover my remote branch which I am not able to see in git ls-remote.
git checkout -bin the first place, or name branch withgit branch.ls-remotecommand actually goes to remote and checks there to discover what you already know, i.e. that it's gone from there. However You already have locally the 'remote tracking branch' origin/alpha, so simply check that outcheckout -b NewAlpha origin/alphaand now you have it 'front of house' and can push it to the remote replace the missing 'alpha'.