It is a fairly common SQL Server belief that Truncate Cannot Be Rolled Back Because It Is Not Logged. However the code in your question just verifies that this is in fact a myth.
TRUNCATE
does entail much less logging than DELETE
as it only logs the page deallocatons and some metadata updates to system tables rather than recording the entire contents of the deleted rows to the log (See a detailed breakdown of logging here).
SQL Server continues to lock the deallocated pages until the transaction commits preventing their re-allocation so ROLLBACK
of a TRUNCATE
simply needs to reverse these page deallocations and system table updates that are recorded in the log.