0

I have created two branch with the same feature/Dev23 and feature/dev23.

At the time of checkout in IntelliJ I was getting "there exist a branch with the same name".

So I deleted one (feature/Dev23) and checkout the new feature/dev23.
But now I want this branch as well.

I am expecting the branch to be seen in Bitbucket and retrieve it properly.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Weird Soul
  • 11
  • 1

1 Answers1

0

But now I want this branch as well.

From a command line, check the output of git reflog: you can use said output to recover a deleted branch (assuming it was deleted recently)

git switch -c feature/old-Dev23 HEAD@{**number**} 

If feature/Dev23 is not listed in reflog (because you never switch to it), check the output of git branch -avv, and:

git switch -c feature/old-Dev23 origin/Dev23

Note I use a different name to re-create the branch, that way it does not interfere with your new feature/dev23.
See this answer bon branch name case sensitivity.

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