David Jackson, 24, and two other men launched an attack on Daniel Sharkey in Branxholme Road on the afternoon of August 19 last year.
But as he tried to get his intended victim, Jackson pushed over the youngster who was walking home from school with his mother, the boy suffering a cut to his head.
Mr Sharkey suffered bruises and cuts to the face in the assault, carried out in front of the terrified youngster.
Jackson pleaded guilty at Jedburgh Sheriff Court to two charges of assault to injury.
Depute fiscal Joanne Waller said the incident happened at around 3.15pm when the child was walking home from school.
She said: “The accused approached Mr Sharkey and ran behind the child for cover. But in doing so he knocked the child to the ground.
"The accused and two others then repeatedly punched Mr Sharkey … the other two males ran off.
Paramedics checked the child over and he did not require hospital treatment, and Mr Sharkey’s injuries were deemed minor.
The accused was later traced by the police.
Defence lawyer Mat Patrick said: “This is obviously a concerning incident due to the presence of the child. Happening in a public place, this kind of thing is undesirable."
Sheriff Valerie Johnston deferred sentence until November 9 for the production of background reports.