(1) Open the MariaDB command line interface and then SELECT the database you are using with the following command:
```
USE database_name;
```
(2) You can start a transaction with the START TRANSACTION command:
```
START TRANSACTION;
```
(3) Now you can execute the commands or queries you need.
(4) If an error occurs or you decide you want to cancel the changes made after the START TRANSACTION command, you can use the ROLLBACK command.
For example, let’s say you delete a row from a table and then decide to undo that action. This can be done as following:
```
START TRANSACTION;
DELETE FROM table_name WHERE condition;
ROLLBACK;
```
The ROLLBACK command will reverse all changes made after the START TRANSACTION command. After rolling back, the data will return to its state prior to the start of the transaction.
(5) However, if you want to save your changes, use the COMMIT command as follows:
```
START TRANSACTION;
DELETE FROM table_name WHERE condition;
COMMIT;
```
In this case, COMMIT will save all changes to the database since the last START TRANSACTION command. The changes can no longer be rolled back after running the COMMIT command.