I'd like to move my last few commits from master into a branch of their own.
The tree on my PC looks like that:
W (some branch)
/
X1--X2--X3--X4--Y--Z1--Z2 (master)
I'd like it to look like:
W (some branch)
/
X1--X2--X3--X4 (master)
\
Y--Z1--Z2 (my new branch)
However, the tree at GitHub looks like:
W (some branch)
/
X1--X2--X3--X4--Y (master)
That's what I saw as a solution for moving the last commits to another branch:
git checkout master
git branch my_new_branch
git reset <commit_id>
My question is: would I be able to successfully push to GitHub after moving the commits into a new branch and if so would it require to do something else than these three commands?