Creating the patch git format-patch -1 <sha> OR git format-patch -1 HEAD Applying the patch git apply --stat file.patch # show stats. git apply --check file.patch # check for error before applying