Description:
We need to rename a branch using Git.
Solution:
This works of course only on local branches, but it should be enough.
git branch -m <current_name> <nnew_name>
You don’ need to change branch in order for this to work. Then, if you need to remove the wrongly named branch just use the delete option (-D), as described here.