Steven Reynolds kicked the door in at Granelli's Sweet Shop, on Broad Street, at 8.35pm, on November 8, causing £200 of damage, said prosecutor Brian Outhwaite.
Officers arrived as he was emerging from the shop, carrying a St Luke's charity box, containing £50-£90, a glass jar with £40, and an RSPCA tin containing £100. He also took money from the till and the £70 float.
Reynolds fled in the direction of Cricket Inn Road, Mr Outhwaite said, and struggled when he was detained, bending a WPC's thumb back as he was arrested.
Sheffield Crown heard he has a "very poor" record, with 35 non-dwelling burglaries. He was jailed for burglary in 2014, 2015 and 2019, and received three years for three counts of burglary and making a false representation in October 2019.
Joy Merriam, mitigating, said: "His greatest mitigation is his plea of guilty."
She said it was a "spontaneous" and "unsophisticated" burglary committed after he had been drinking, but he was "genuinely remorseful and took full responsibility."
"He did not test positive for drugs," she said. "This was not an offence committed to fund his drug habit. He had remained essentially drug-free since his release.
"He admitted taking cocaine at a party but has not taken crack cocaine."
Ms Merriam said Reynolds had some work lined up in a scrap yard before the pandemic.
"He cannot understand why he committed this offence," she said. "I would ask your Honour to give serious consideration to suspending the sentence."
Reynolds, 39, of Maltravers Road, Sheffield, pleaded guilty to commercial burglary and resisting a constable, when he appeared at Sheffield Magistrates Court, on November 10.
Judge Peter Kelson QC told him his current sentence will expire on December 8.
He said the correct sentence would be four months, but it would be appropriate to suspend it for two years. He added 25 rehabilitation days.
"The court has a hold on you for two years," the judge said. "If you commit any more offences over the next two years you are at risk of serving the four months."