Reputation: 32904
I just made some changes in the wrong child branch.
I have master branch and from it I have branches A and B. In branch A there are already changes from master. Branch B has not been created yet.
I just made the changes I need for branch B in branch A. These changes are on my computer only, I have not committed them yet on my computer and have not synced them to the A branch on Git. (I do all this in VisualStudio).
Is there some way to push/move the changes on my computer to a new branch B? Every file I edited is identical in master & A.
Upvotes: 4
Views: 4743
Reputation: 10915
Check out git help stash
. Since you haven't made a commit with these files - your workspace is "dirty" with the changes you want to move - you can move them through the stash.
git stash # make your working directory clean, save the changes for later
git checkout master
git checkout -b B # create your new branch from master
git stash pop # apply the changes to the new branch
Upvotes: 6