Cherry-picking

git cherry-pick cc9cdf189d1eb111ecda5fe7916347edea6025a6
Only use this when you don't want to merge the branch you're picking from. The most important reason for this is that merging retains commit SHA-1s, but cherry-picking does not; thus you lose tracability.

For example: I currently wanted a feature branch that only contained two commits, but was based on three branches that I didn't want. What I did was
$ git checkout master
$ git checkout -b my_feature_squash
$ git cherry-pick abc
$ git cherry-pick cde
<I edited a file>
$ git commit -a
$ git rebase -i HEAD~4
(I actually branched before rebasing to avoid rebase mistakes; nonetheless.) If you want to cherry-pick without committing it to the head of your current branch use
$git cherry-pick -n cc9cdf189d1eb111ecda5fe7916347edea6025a6