Minecraft wiki entry for Defeating_a_village_raid, associated text: If you accidently hit a naturally spawned iron golem (or one you summoned) and the iron golem starts attacking, go find some raid mobs and make the iron golem attack the raid mobs as an distraction. Use the time to calm down the iron golem (staying away from the iron golem for a minute or turning the gamemode to creative and back to survival).