Let us assume that you are on branch X, and you want to cherry-pick the commits Y..Z.
- git checkout -b tempZ Z
- git rebase Y
- git checkout -b newX X
- git cherry-pick Y..tempZ
- (optional) git branch -D tempZ
Let us discuss what these commands will do. First, a branch tempZ based on Z will be created, but with the history from Y onward linearized, and then cherry-pick that onto a copy of X called newX. (It's safer to do this on a new branch rather than to mutate X.) Of course there might be conflicts in step 4, which you'll have to resolve in the traditional way (cherry-pick works very much like rebase in that respect). Finally it deletes the temporary tempZ branch.
Note that if step 2 gives the message "Current branch tempZ is up to date", then Y..Z was already linear, so just ignore that message and proceed with steps 3 onward.