Minor changes to Diff module.

* Added output function in Diff.restore_*.
* Added some comments explaining what the code does.