Phillip Mason, 24, concealed the underwear, which was valued at £28, under his jacket, took it home and put it in a cupboard.
Three weeks later, on November 28 last year, he broke into a works van and stole the front from a stereo, but left behind a screwdriver with his DNA on it, and was arrested on December 11.
Emma Birt, prosecuting, said Mason had been jailed for 14 days in February for the theft of meat, and had a string of previous convictions for shoplifting, burglary and thefts from vehicles.
Ali Rafati, for Mason, said his client was a long-term heroin addict who needed to be taken off the streets and rehabilitated.
Judge Francis Gilbert QC told Mason, from Laurel Dene, North Prospect, that he gave him credit for guilty pleas to two charges of theft.
However, the judge added: “Offending is habitual for you and you have a continuing disregard for other people’s property.”
Although he was receiving the heroin substitute methodone, Mason was also continuing to take heroin, the judge told the court.
Judge Gilbert jailed him for nine months for the vehicle break-in and one month concurrent for the knicker theft, a total of nine months.