Another variant worth mentioning is that if you want the last n
commits from a branch, the ~
syntax can be useful:
git cherry-pick some-branch~4..some-branch
In this case, the above command would pick the last 4 commits from a branch called some-branch
(though you could also use a commit hash in place of a branch name)