Also, you can check my Git Project based on this article :
I am creating a table and rolling it back in case of any error during creation in above example.
A better used case to get you started - You can have multiple sql statements instead of just one - like creating a table, creating primary keys, and then also inserting data into the table. If any of the statements fail, you can drop the table as a rollback step.
The above link has the usage of rollback. It's very minimal and basic. Not sure if it would help your use case , however looks like a good starting point.