I created a new experimental branch on my local machine:
git checkout -b feature/random-experiments
Then made some changes to a few files and committed them:
git add .
git commit -m "1st cut - added cool new experimental feature"
git push
Later, we created a user story (U-123) and then decided to rename my branch to follow our naming standard. I deleted the remote branch via stash's browser UI. Then:
git branch -m feature/U123-Add-Cool-New-Feature
Then made some changes and committed:
git add .
git commit -m "clean up & refactor"
But now, when I do a git status
$ git status
On branch feature/U123-Add-Cool-New-Feature
Your branch and 'origin/feature/random-experiments' have diverged,
and have 1 and 1 different commit each, respectively.
(use "git pull" to merge the remote branch into yours)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
It looks like my local branch is still pointing to the old remote branch. This is a problem because the old (remote) branch at origin : 1) had a different name 2) is no longer there as I deleted it.
What is the best way to fix this?