Fiqh-us-Sunnah Volume 003, Zakaat and Fasting, Fiqh 3.139D.

Section : If one eats, drinks, or has intercourse, thinking that the sun has set or that fajr has not occurred.

In such cases, according to most scholars and the four imams, that person is to make up that day. However, there is a difference of opinion on this point. Ishaq, Dawud, Ibn Hazm, 'Ata, 'Urwah, al-Hassan al-Basri, and Mujahid maintain that such a fast is sound and that the person need not make up the day later. They base their opinion on the fact that Allah says in the Qur'an: "And there is no sin for you in the mistakes you make unintentionally, but what your hearts purpose [that will be a sin for you]."