I started doing work in master - many changes later (no commits) I realized that this work should be done in a separate branch.
Can I create a new branch with my current changes, then discard the changes in master back to its pristine state?
Thanks
I figured it out.
while on master:
git branch [new-branch]
git checkout [new-branch]
...continue editing - in my case I committed them...
git add .
git commit -am 'updates'
switch back to master
git checkout master
Branch was in original state before I started making all the changes...
Hope this helps somebody else!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With