Diff, patch

printf "AAAA\nBBB\nCCC" > file
printf "AAAA\nBBB\nDDD" > file_new
diff -u file file_new > file.patch
cat file.patch
# --dry-run = it will simulate the patching
patch --dry-run file file.patch
# -b = backup, it will create file.orig
patch -b file file.patch