A garda witnessed a 20-year-old man knock a female unconscious in the early hours of the morning, a Dundalk Court has heard.