11/23/2013 - 5:24 PM

Drupal patch Reversing patches

Drupal patch Reversing patches

patch -p1 < path/file.patch

patch -p1 -R < path/file.patch

Reversing patches

Last updated March 15, 2016.

You can reverse a patch if you have finished testing it, or if you want to see whether a problem has been introduced by a particular patch. You should also reverse a patch prior to adding a newer, updated version of the same patch. To reverse the patch, use the patch command with the -R option:

patch -p1 -R < path/file.patch
(If your patch was applied with the -p0 option, use that instead.)


git apply -R path/file.patch