Which one is the correct indirect narration? “Why have you beaten my dog”? he said to me.

Answer: 
He demanded of me why I had beaten his dog
Which one is the correct indirect narration? “Why have you beaten my dog”? he said to me.