The 35-year-old was hit on the head by a man who attacked him from behind on Scott’s Street in Annan, Dumfries and Galloway.
He was taken by ambulance to Dumfries and Galloway Royal Infirmary following the incident at around 11pm on Friday.
The victim was later released from hospital after receiving treatment.
No description of the attacker is available.
Appealing for information, Sergeant Alan Dillon, of Annan police office, said: “The man had just left work nearby and was in Scott’s Street, where he was attacked.
“From our inquiries so far, two men were seen running away from Scott’s Street through Newington Park after the attack.
“Officers are currently checking CCTV in the area and carrying out door-to-door inquiries.
“However, I would appeal to anyone who was in the area who may have seen the attack, or who has any information that will assist officers with their investigation, to contact Annan police office via 101 or Crimestoppers on 0800 555 111.”