Lee Spencer’s attack on the woman was witnessed by the eight-year-old child of a neighbour, on Bagshaw Street, Pleasley, on August 23.
Prosecutor Lee Shepherd said: “He grabbed her in a bearhug and threw her away from the door.”
He then grabbed her by the neck and dragged her by the hair, the court heard.
Spencer was last before the court on August 15, when he received a conditional discharge for possession of cannabis.
He was jailed for 24 weeks in February last year for shoplifting and assaulting a police officer, Mr Shepherd added.
Probation officer Raqia Bano said: “He was unable to recall the offence after taking 20 millilitres of diazepam, because he had been having problems sleeping and the arrival of a new-born baby.”
She said he was currently taking a Subutex prescription following his addiction to heroin.
“He was remorseful and apologetic,” she said.
David Grant, mitigating, said: “He had been through an awful period of lack of sleep.”
He said Spencer’s doctor had refused to prescribe him anything “point blank”, which was “not surprising because he had dependency problems.”
Mr Grant said the drugs had the effect of “disinhibiting him.”
“He wants to get his family back together,” Mr Grant added.
Spencer, 35, of James Murray Mews, admitted assault by beating when he appeared at Mansfield Magistrates Court, on August 23.
He was given an 18 month community order, and must attend 30 sessions of a building better relationships programme, and ten days of a rehabilitation activity.
He must pay £85 costs and an £85 government surcharge.