git create only changed file diff, maintaining file structure

bellow commands to create zip archive containing only changed files between range of commit

diff between HEAD and specified revision number

git archive -o HEAD $(git diff --name-only GIT_REVISION_NUMBER_HASH_HERE)

diff between HEAD and previous commit only

git archive -o HEAD $(git diff --name-only HEAD^)

to crate archive from branch

git archive BRANCH_NAME -o