I am new to Git and learning to use it for my project. Currently, I'm wondering how to switch uncommitted work to a branch when I have accidentally been working in master
. I am working on my own, but want to keep things organized anyway.
For example, I have made a series of commits and master
is up to date. I then begin working on the master branch, but decide the work will be more involved than predicted, so I would prefer to be doing it in some other branch.
I can certainly commit the changes up till then to master
and then start from there in a new branch, but I would rather have all the stuff I've been doing since my last commit in that new branch. What is the simple approach to doing this?
Is this a case where a git reset --soft
would be needed? Or is there a simpler approach? Thanks.