Create a branch in Git from another branch – Stack Overflow

2. To create a new branch from the branch you do have checked out: git branch new_branch This is great for making backups before rebasing, squashing, hard resetting, etc.—before doing anything which could mess up your branch badly. Example: I’m on feature_branch1, and I’m about to squash 20 commits into 1 using git rebase -i master.

Read More