A man in his 20s who became embroiled in a street brawl in a midlands town was in such a drunken state he inadvertently punched a garda believing it was the man he was fighting, a court has been told.