It is narrated from Hazrat Nafi that when Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) was asked about forgetting in prayer, he said: He should think about what he has forgotten and then recite it.
Hadith Referenceموطا امام مالك رواية يحييٰ / كتاب الصلاة / 214