Creating a git branch after making changes to the wizard

I started to do work in master - many changes later (without commits) I realized that this work should be done in a separate branch.

Is it possible to create a new branch with my current changes and then undo the changes in the initial state to the original state?

thank

+5
source share
1 answer

I get it.

while on the host:

git branch [new-branch]
git checkout [new-branch]

... continue editing - in my case, I committed them ...

git add .
git commit -am 'updates'

back to mastery

git checkout master

The branch was in its original state before I started to make all the changes ...

Hope this helps someone else!

+4
source

All Articles