It is sometimes necessary to make changes to pronouns when we use reported speech. This depends on whether the person reporting and the original speaker are the same or not.
Look at these examples:
|I’m hungry,” he said.||He said he was hungry.||I am → he was|
|I“I think it’s this way,” I said.||I said I thought it was this way.||I think → I thought|
|“He told me to wait,” said Sheila.||Sheila said he told her to wait.||told me → told her|
|“You have to go now,” he told us.||He told us that we had to go then.||you have to → we had to|