See the documentation here: https://docs.mendix.com/refguide/rollback-object
And especially this part:
The rollback-object action can be used to undo changes (that have not been committed) that were made to the object in the part of the flow preceding the activity. Furthermore, it deletes objects that have been created but have never been committed.
Regards,
Ronald