It is narrated from Sayyiduna al-Bara' bin Azib (may Allah be pleased with him) that some people said: Those who died or were martyred before the change of the qiblah, we do not know what to say about them. So Allah Almighty revealed this verse: "And Allah would never let your faith (your prayers) go to waste. Indeed, Allah is Most Kind and Most Merciful to the people." [Surah al-Baqarah: 143]
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2192