Recreating a file from diff
3 answers
If you have:
- old file and
- diff
then it's just a matter of applying diff in the usual way:
patch the_file <the_diff
This is a common use case for diff.
If you have:
- new file and
- diff
then you can simply apply the patch in reverse order with the option patch
-R
:
patch -R the_file <the_diff
+2
source to share