Our recommended way of adding codes to the head is using the Hook Element, found in Appearance > Elements.
If you added it there you should be able to go back there and remove it.
If you didn’t add it there then i don’t know…. how did you add the code ?
Simplest solution would be to install a backup of the site.