How do I revert back to my old branch name?

Viewed 44

I have changed the branch name locally ,from (hospital-flow-bug-fix) to (constant-OTP-removal)

Now after using git reflog I am not able to get the branch from where I cut this(hospital-flow-bug-fix) branch.

I want to know from where I cut the branch named(hospital-flow-bug-fix)

I want to know whether I cut this from Prod branch or Dev branch.

Any command to revert the new branch name ?

1 Answers

If you had pushed that branch hospital-flow-bug-fix before, you would still have origin/hospital-flow-bug-fix as a marker of the old branch.
But if you had not, and more than 90 days have lapsed since this rename, then git reflog woud not help you indeed.

If you have only added commits to constant-OTP-removal since the rename (meaning no rebase operation), then you have follow its history until you see de Dev or Prod branch.

Do a visual check with

git log --graph --format=format:"%h% - %aD (%ar)%d%n %s - %an" --abbrev-commit --all --branches
Related