Jami` at-Tirmidhi, Volume 5, Book 44, Hadith 3050 (DarusSalam) ⓘ
Narrated Al-Bara: "A man among the Companions of the Prophet died before Khamr had been made unlawful. So when Khamr was made unlawful, some men said: 'How about our companions who died while drinking Khamr?' So (the following) was revealed: Those who believe and do righteous good deeds, there is no sin on them for what the ate, if they have Taqwa and perform good (5:93)."
حَدَّثَنَا عَبْدُ بْنُ حُمَيْدٍ، حَدَّثَنَا عُبَيْدُ اللَّهِ بْنُ مُوسَى، عَنْ إِسْرَائِيلَ، عَنْ أَبِي إِسْحَاقَ، عَنِ الْبَرَاءِ، قَالَ مَاتَ رِجَالٌ مِنْ أَصْحَابِ النَّبِيِّ صلى الله عليه وسلم قَبْلَ أَنْ تُحَرَّمَ الْخَمْرُ فَلَمَّا حُرِّمَتِ الْخَمْرُ قَالَ رِجَالٌ كَيْفَ بِأَصْحَابِنَا وَقَدْ مَاتُوا يَشْرَبُونَ الْخَمْرَ فَنَزَلَتْ : ( لَيْسَ عَلَى الَّذِينَ آمَنُوا وَعَمِلُوا الصَّالِحَاتِ جُنَاحٌ فِيمَا طَعِمُوا إِذَا مَا اتَّقَوْا وَآمَنُوا وَعَمِلُوا الصَّالِحَاتِ ) . قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ .
also referenced under: Hadith 3050 (Reference) & Book 47, Hadith 3327 (In-Book)