I was on branch-x
and made few changes and committed them (but did not push). Although the commits were correct, they should not have been made in branch-x
but instead in branch-y
. How can I take the commits from branch-x
and apply them to branch-y
. I want to avoid pushing the committed changes from branch-x
.
Below is what I did in commands.
(branch-x)$: git status
(branch-x)$: git add .
(branch-x)$: git commit -m "some commit"
<oops, I should have made these changes in branch-y>
(branch-x)$: git checkout -b branch-y
(branch-y)$: <how can I take the commit from branch-x and apply it here?>