Reverting a transaction is pretty easy in Hyperledger Fabric Composer, you just have to throw an error, like:
throw new Error('Error message');
If an error is thrown, the whole transaction is rolled back. However, surprisingly, the catch logic can be used to stop the exception propagation. If the exception is not propagated to the top, the transaction is not reverted.