How to not to mess up with Git “master” branch
Categorized as Misc
You always learn something new with Git.
For example, you have made many changes to the codebase and suddenly realize that you’re working on a master branch. That seems odd. So, the decision is just as simple as this:
git switch -c new_branch
This command creates a new branch and brings all of your local changes over.