TIL: Create and apply git patch

:til: :git:

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