This topic is discussed under Indirect speech » Changes in indirect speech » Tense changes in indirect speech.
For timeline diagrams, quotes and exercises, check out our e-book The Grammaring Guide to English Grammar