You have the following options:
And then apply using:
apply-patch-to-file -i ~/patches/0001-my-test-commit.patch
You will be asked to indicate which files the patch should apply.
Use the patch command directly, creating diff as:
git diff HEAD^ -- hello.test > ~/patch_file
Then apply diff to another file:
patch -p1 another_path/subdir/different_file.test ~/patch_file
source share