A transaction is a way to ensure either ALL statements succeed, or none do.
For example, to transfer money from Bob's bank account to Alice, one might do this:
UPDATE accounts SET amount = amount - 100 WHERE name = 'Bob';
UPDATE accounts SET amount = amount + 100 WHERE name = 'Alice';
But imagine if something goes wrong (server crashes because power goes out) after the first statement. The bank now has deducted 100 dollar from Bob, but Alice got nothing!
To avoid that, we use a transaction. As Etan explained: you first BEGIN, then you execute all statements. If all went well, you then COMMIT. Only then the modifications are saved.
If something goes wrong (eg there is no account for Alice) you can ROLLBACK, or the server will ROLLBACK if something goes seriously wrong (ie power goes down).
To answer your UPDATE
If you have Updated something in a table you can reset the previous value using this function only if you started with BEGIN and did not COMMIT yet, yes.