The Illustrated Guide to Criminal Law Chapter 8: What Have You Done? Page 9: Transferred Intent
So if Joe intended to hurt Simon, but then accidentally hit him with his car, even though he caused the harm and had the right intent, he did not commit the act with that intent, and so he is not guilty.
Joe backing over Simon in his car, saying “oops!”
Now what if Joe meant to main Simon, and threw a brick at him, but missed and maimed Mamie instead?
Brick missing sauntering Simon and striking a woman in the back of the head. Nearby barbershop quartet (including Average Joe) sing “He missed and maimed Mamie instead!”