Save or apply a git patch Posted at — Jun 8, 2019 git diff > foo.patch; git reset; echo do stuff; git apply foo.patch Learn more about git patches Command Line