It is narrated from Sayyiduna Ali (may Allah be pleased with him) that a man of the Ansar invited Sayyiduna Ali and Sayyiduna Abd al-Rahman bin Awf (may Allah be pleased with them both), and the two of them drank wine before wine was made unlawful. Sayyiduna Ali (may Allah be pleased with him) led them in the Maghrib prayer and recited this surah, "Say: O disbelievers" [Surah al-Kafirun: 1], and he jumbled the recitation. Then this verse was revealed: "Do not approach prayer while you are intoxicated, until you know what you are saying" [Surah al-Nisa: 43].
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 1828