Allah then said, "Remember My favor on you when I forgave you for worshipping the calf.'' This happened after Musa went to the meeting place with his Lord at the end of that period which was forty days. These forty days were mentioned in Surat Al-A`raf, when Allah said,
﴿ وَوَٲعَدۡنَا مُوسَىٰ ثَلَـٰثِينَ لَيۡلَةً۬ وَأَتۡمَمۡنَـٰهَا بِعَشۡرٍ۬ ﴾
(And We appointed for Musa thirty nights and added (to the period) ten (more)) (7:142).
It was said that these days were during the month of Dhul-Qa`dah plus the first ten days in Dhul-Hijjah, after the Children of Israel were delivered from Fir`awn and they safely crossed the sea. Allah's statement,
﴿ وَإِذۡ ءَاتَيۡنَا مُوسَى ٱلۡكِتَـٰبَ ﴾
(And (remember) when We gave Musa the Scripture) means, the Tawrah,
﴿ وَٱلۡفُرۡقَانِۚ ﴾
(And the criterion) that is that which differentiates between truth and falsehood, guidance and deviation.
﴿ لَّعَلَّكُمۡ تَهۡتَدُونَ ﴾
(So that you may be guided aright), after escaping the sea, as another Ayah in Surat Al-A`raf clearly stated,
﴿ وَلَقَدۡ ءَاتَيۡنَا مُوسَى ٱلۡڪِتَـٰبَ مِنۢ بَعۡدِ مَآ أَهۡلَكۡنَا ٱلۡقُرُونَ ٱلۡأُولَىٰ بَصَآٮِٕرَ لِلنَّاسِ وَهُدً۬ى وَرَحۡمَةً۬ لَّعَلَّهُمۡ يَتَذَكَّرُونَ ﴾
(And indeed We gave Musa ـ after We had destroyed the generations of old ـ the Scripture (the Tawrah) as an enlightenment for mankind, and a guidance and a mercy, that they might remember (or receive admonition)) (28:43).
﴿ وَإِذۡ قَالَ مُوسَىٰ لِقَوۡمِهِۦ يَـٰقَوۡمِ إِنَّكُمۡ ظَلَمۡتُمۡ أَنفُسَڪُم بِٱتِّخَاذِكُمُ ٱلۡعِجۡلَ فَتُوبُوٓاْ إِلَىٰ بَارِٮِٕكُمۡ فَٱقۡتُلُوٓاْ ﴾
(54. And (remember) when Musa said to his people: "O my people! Verily, you have wronged yourselves by worshipping the calf. So turn in repentance to your Creator and kill yourselves (the innocent kill the wrongdoers among you), that will be better for you with your Creator.'' Then He accepted your repentance. Truly, He is the One Who accepts repentance, the Most Merciful.)