Michael Mulholland pleaded guilty at Jedburgh Sheriff Court to a charge of assault to injury on October 2.
The court was told police officers were called to the property in Wellington Court after neighbours heard the commotion.
Defence lawyer Liam Alexander said his client claimed he was retaliating after being attacked himself.
Sheriff Peter Paterson fined Mulholland a total of £420 and ordered him not to approach or contact the woman between the hours of 5pm and 10am for the next two years.

