TIL: Create and apply git patch

:git:

  • To create git patch execute git format-patch HEAD^.
  • To apply patch run git apply file.patch.