Q:

How to move branch HEAD from one branch to anonther

A have such hierarchy in Git:
- master \
         - feature1 
         - feature2 \
                    - mybranch

feature2 have 20 additional commits from feature1.
I created new branch(mybranch) and accidentally found that it was created from wrong feature. All my changes in new files, and doesn't affect any files from feature1 or feature2. 
How I can move my branch HEAD from feature2 to feature1?

A:

You should use the git rebase --onto feature that is exactly to do that. 
First, be sure to have 'mybranch' checked out. 
Then:
git rebase feature2 --onto feature1

You are telling git to take all the commits between 'feature2' and the tip of the current branch 'mybranch' and re-apply them onto 'feature2'.
Ps: That's not a 'normal' rebase that you should do (interactive or not) or you will end up with also all the 20 commits introduced by 'feature2' 

