It happened at about 9pm in Kirton Lane, Doncaster, on Wednesday, April 7.
The victim was was alone inside his house when three men, one of whom was said to be carrying a weapon, forced their way in.
A struggle took place, during which O’Brien assaulted the 33-year-old victim.
All three men then ran away.
Lee O’Brien was identified by West Yorkshire Police after they reviewed CCTV footage of the incident.
O’Brien, 23, was arrested one week later on Wednesday, April 14.
He was later charged with Section 47 Assault and attempted burglary.
O’Brien, of Cecil Mount, Armley, was sentenced to four years imprisonment at Sheffield Crown Court on Tuesday, June 15.
DC Paul Rooney, of South Yorkshire Police, said: “We are still not sure what prompted O’Brien to visit Kirton Lane and carry out this attack, but I am pleased he admitted the part he played and has now been put behind bars.
“Please be reassured that our enquiries are ongoing to identify and locate the two other men involved and put them before the courts.
“I would like to thank the victim for his continued cooperation and support throughout this investigation.”