rebase last commit code example
Example 1: squash commit history git
# THIS TURNS YOUR WHOLE COMMIT HISTORY INTO ONE SINGLE COMMIT!
# BE CAREFUL!
git rebase --root -i
# In your editor, for each commit except the top, change `pick` to `squash`
Example 2: git rebase one commit
git checkout master
git cherry-pick <commit ID of XX>
git checkout Feature-branch
git reset --hard HEAD^