Try:

git [format-patch](https://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html) -1 <sha>

or

git format-patch -1 HEAD

According to the documentation link above, the -1 flag tells git how many commits should be included in the patch;

-

Prepare patches from the topmost commits.


Apply the patch with the command:

git am < file.patch