This article shows how to extract and archive only files modified or added in a Git commit.
All the examples below are to extract files from the previous commit, but if you change the
HEAD^ part to two commit hashes separated by a space, then it will extract changes between those commits.
git archive --format=zip HEAD `git diff --name-only HEAD^` > archive.zip
zip archive.zip $(git diff --name-only HEAD^)
tar -czvf archive.tgz $(git diff --name-only HEAD^)