"There is no sin for those who believe and do righteous deeds in what they have tasted [consumed] if they fear [Allah]." This means: They drank of the wine before it was forbidden.
Al-Hasan said:
When the prohibition of wine was revealed, they said: "What about our brothers who died while it was in their stomachs, even though Allah has informed [us] that it is a 'rijs' (impurity)?" So Allah revealed: "There is no sin for those who believe and do righteous deeds..." [that is to say: no blame].
﴿لَيْسَ عَلَى الَّذِينَ آمَنُوا وَعَمِلُوا الصَّالِحَاتِ جُنَاحٌ فِيمَا طَعِمُوا إِذَا مَا اتَّقوا﴾ يَعْنِي: شَرِبُوا: مِنَ الْخَمْرِ قَبْلَ أَنْ تُحَرَّمَ.
قَالَ الْحَسَنُ:
لَمَّا نَزَلَ تَحْرِيمُ الْخَمْرِ، قَالُوا: كَيْفَ بِإِخْوَانِنَا الَّذِينَ مَاتُوا وَهِيَ فِي بُطُونِهِمْ وَقَدْ أَخْبَرَ اللَّهُ أَنَّهَا رجسٌ؟ فَأَنْزَلَ اللَّهُ: ﴿لَيْسَ عَلَى الَّذِينَ آمَنُوا وَعَمِلُوا الصَّالِحَاتِ جُنَاحٌ﴾ [إِثْم]