Indeed, you can consider transactions to be 'patches' against the set of unspent outputs (the UTXO set): they consume some outputs, and they create some new outputs. Blocks are aggregated patches.
And indeed, to be able to undo the effects of a block on the UTXO set, a record with the reverse patch is written to the rev*.dat files (corresponding to the blocks in the same blk*.dat file).
The format is custom and very compact. For every transaction input (excluding the coinbase's, which does not spend anything) it contains the script and amount of the output being spent and whether it was created by a coinbase. If the output was the last of a particular transaction being spent, the transaction version and height in the chain it was created at are also stored.