Nathan Hunt, 30, of Meadow Bank Road, Rotherham, drove a gang of youths to burgle properties in Pontefract and South Elmsall near Wakefield on two occasions in November last year - as the first time they had got the wrong house.
On attending his house, police then saw Hunt jump out of a bedroom window and attempt to escape by reversing his car through parked vehicles.
Hunt's barrister told the court he was persuaded to take part in the crimes after being "beaten" by a group of youths.
The court heard that the resident of a house in Woodland View, Pontefract heard loud banging on the evening of November 23, 2021. When he went to inspect what was going on, he found his front door had been removed from its hinges and was lying flat on the floor.
He also saw a number of men in black, wearing facemasks and holding torches. One of them was heard to say they were in the wrong house and they quickly escaped.
Two nights later, at around 10.14pm, a nearby resident heard a loud bang at Cambridge Street, South Elmsall, before noticing a group of men dressed in black leaving with "armfulls" of cannabis plants, which he recognised due to their strong smell.
The court was told that Hunt was the "getaway" driver on both occasions.
On November 26, police visited Hunt's house to find him stood on the ledge of his bedroom window, before he jumped off and got into his BMW. He attempted to reverse away, damaging two cars in the process, before he was stopped by police officers.
Officers returned to the car and found a machete and cannabis. They then searched his house and found a box and a bag each containing cannabis.
Mitigating for Hunt, Richard Barrasell told the court that Hunt had been "badly beaten" by a group of youths, and he was persuaded to drive them to the planned heist on November 23.
Mr Barrasell added: "They got the wrong house, but the defendant did not go in - they scarpered. But this defendant was persuaded to go back when they got the right house.
"The police came to his house and, because he knew he was involved in something serious, he put two and two together and ran away. He is sorry for that.
"He is a young man of only 30. He has a supportive family and a four-year-old daughter. It's his first time in custody, and he says it will be his last. It's a shock to him."
It was also added that since he had been on remand, Hunt had secured a prison job as a cleaner.
Hunt had already pleaded guilty to two counts of burglary, possession of cannabis, having a bladed weapon in a public place and dangerous driving.
Sentencing Hunt, Recorder Anesh Pema addressed the first burglary, stating: "The residents were in significant fear. You were the driver of the getaway car.
"You are remorseful, and I accept your remorse. I also accept that you have not yet gone to prison, and you are making the most of your time there."
He sentenced hunt to five years imprisonment.