Sometimes we need to switch one commit from one branch to another. Then we need to execute following commands step by step.

git checkout branch_2
git merge branch_1
git checkout branch_1
git reset --hard HEAD~1 
git checkout branch_2 
reference : stackoverflow