The court heard that police were called to the Abercorn Road area of Derry at around 3.30am where a male was reportedly kicking another man on the ground.
They found McDermott trying to get back to the man on the ground and being restrained by two females.
Police had to use CS spray and handcuffed the defendant and he tried to swing at police.
When interviewed he made a no comment interview.
Defence solicitor Seamus Quigley said that his client was currently serving a prison sentence in Castlerea and was not due for release until 2025.
He said McDermott had consumed ‘an awful lot of alcohol’ and said he had long term issues with drink and drugs.
District Judge Barney McElholm said this was an attack on a man ‘who happened to be walking up the street.’
He said the victim had actually lost consciousness during the attack.
He imposed a sentence of 6 months imprisonment.