Sheriff William Gilchrist branded the stunt an "extraordinary sequence of dangerous driving" and said it could have caused a serious accident.
Stirling Sheriff Court heard that David Russell, 25, stole the lorry from the Stirling Council compound at Fallin, Stirlingshire, where it had been left overnight with the keys in the ignition.
He then led police on a chase for miles through the Stirlingshire countryside and pulled over twice before slamming the stolen lorry into the reverse and trying to ram police cars.
He pleaded guilty at an earlier hearing and sentence was deferred until yesterday for a psychiatric report.
The court heard the report found Russell was not suffering from a mental disorder and made no psychiatric recommendation.
Sheriff Gilchrist jailed Russell for four months and imposed an 18-month community payback order on his release. He also banned him from driving for 16 months.