The Children of Israel kill each other in Repentance
Allah tells;
وَإِذْ قَالَ مُوسَى لِقَوْمِهِ يَا قَوْمِ إِنَّكُمْ ظَلَمْتُمْ أَنفُسَكُمْ بِاتِّخَاذِكُمُ الْعِجْلَ فَتُوبُواْ إِلَى بَارِيِكُمْ فَاقْتُلُواْ أَنفُسَكُمْ ذَلِكُمْ خَيْرٌ لَّكُمْ عِندَ بَارِيِكُمْ فَتَابَ عَلَيْكُمْ إِنَّهُ هُوَ التَّوَّابُ الرَّحِيمُ
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.
This was the repentance required from the Children of Israel for worshipping the calf.
Commenting on Allah's statement;
وَإِذْ قَالَ مُوسَى لِقَوْمِهِ يَا قَوْمِ إِنَّكُمْ ظَلَمْتُمْ أَنفُسَكُمْ بِاتِّخَاذِكُمُ الْعِجْلَ
(And (remember) when Musa said to his people;"O my people! Verily, you have wronged yourselves by worshipping the calf...), Al-Hasan Al-Basri said,
"When their hearts thought of worshipping the calf,
وَلَمَّا سُقِطَ فَى أَيْدِيهِمْ وَرَأَوْاْ أَنَّهُمْ قَدْ ضَلُّواْ قَالُواْ لَيِن لَّمْ يَرْحَمْنَا رَبُّنَا وَيَغْفِرْ لَنَا
And when they regretted and saw that they had gone astray, they (repented and) said;"If our Lord does not have mercy upon us and forgive us," (7;149),
This is when Musa said to them,
يَا قَوْمِ إِنَّكُمْ ظَلَمْتُمْ أَنفُسَكُمْ بِاتِّخَاذِكُمُ الْعِجْلَ
(O my people! Verily, you have wronged yourselves by worshipping the calf...)."
Abu Al-Aliyah, Sa`id bin Jubayr and Ar-Rabi` bin Anas commented on,
فَتُوبُواْ إِلَى بَارِيِكُمْ
(So turn in repentance to your Bari) that it means,
"To your Creator."
Allah's statement,
إِلَى بَارِيِكُمْ
to your Bari (Creator),
alerts the Children of Israel to the enormity of their error and means,
"Repent to He Who created you after you associated others with Him in worship."
An-Nasa'i, Ibn Jarir and Ibn Abi Hatim recorded Ibn Abbas saying,
"Allah told the Children of Israel that their repentance would be to slay by the sword every person they meet, be he father or son. They should not care whom they kill. Those were guilty whom Musa and Harun were not aware of their guilt, they admitted their sin and did as they were ordered. So Allah forgave both the killer and the one killed."
This is part of the Hadith about the trials that we will mention in Surah Ta Ha, Allah willing.
Ibn Jarir narrated that Ibn Abbas said,
"Musa said to his people,
فَتُوبُواْ إِلَى بَارِيِكُمْ فَاقْتُلُواْ أَنفُسَكُمْ ذَلِكُمْ خَيْرٌ لَّكُمْ عِندَ بَارِيِكُمْ فَتَابَ عَلَيْكُمْ إِنَّهُ هُوَ التَّوَّابُ الرَّحِيمُ
"So turn in repentance to your Creator and kill each other (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.
Allah ordered Musa to command his people to kill each other. He ordered those who worshipped the calf to sit down and those who did not worship the calf to stand holding knives in their hands. When they started killing them, a great darkness suddenly overcame them. After the darkness lifted, they had killed seventy thousand of them. Those who were killed among them were forgiven, and those who remained alive were also forgiven.