This is pretty basic, but I'll add more as the questions come up.
patch is another tool that complements diff, it will apply the differences in the “patch” file to the target file. Think of it is a way to “patch” your old files with newer modifications.
How to use patch
To apply the patch, change into the same directory as the unmodified file and execute
patch < file.patch
This is how to apply patch to an entire directory,
patch -p0 < program.patch
Patch applied can be simply removed by adding the -R switch,
patch -p0 -R < program.patch
patch -R < file.patch





