Andrew Jackson was seen entering the changing rooms at SportsDirect, on St Peter’s Retail Park, with two tops, but only returned one to the racks, on May 12.
He was detained with a £39 Nike top, and later told police he was homeless, and wanted some new clothing, said prosecutor Robert Carr.
He was last before the court in 2011.
Andrew Bostock, mitigating, said Jackson had been hit hard by the recent deaths of his partner and brother, and this led him back to drug problems.
“He was on the streets and he was getting hassle from local youths about what he was wearing,” said Mr Bostock.
“He went into the store to get something different to wear.
“His circumstances haven’t improved much. He is still of no fixed abode, but he can stop at friends’ addresses and is receiving help for the drugs.”
At the time of the offence, Jackson’s benefits had been sanctioned, he added.
Jackson, 39, care of Longstone Way, Mansfield, admitted theft when he appeared at Mansfield Magistrates Court, on Friday.
Deputy district judge Stephen Jonas said: “I am sorry to hear things have taken a turn for the worst but that doesn’t justify offending.
“I am sure this is a one-off.”
Jackson was given a 12 month conditional discharge, and must pay a £20 government surcharge, but no costs were awarded because of his means.