Let's read the official documentation:
dnf history rollback <transaction-spec>Undo all transactions performed after the specified transaction. If it is not possible to undo any transaction due to the current state of RPMDB, do not undo any transaction.
Emphasis is mine. So this command refers to the undo command. Okay, let's read the documentation concerning undo:
dnf history undo <transaction-spec>Perform the opposite operation to all operations performed in the specified transaction. If it is not possible to undo any operation due to the current state of RPMDB, do not undo any operation.
It sounds that those two commands do the same things with the exception that the former can undo several transactions, and the later just one.
Is this understanding correct? (I would appreciate answers from first-hand experience, not from the point of view how you interpret the manual, I'm interested in facts, not guesses.)
Context: I need to write a script that runs dnf upgrade -y and then runs some tests and then reverse the dnf changes if the tests fail. I'm looking for the best way of achieving this.