كتاب الصيام
13  
The Book of Fasting
(25)
Chapter: The Saying of Allah Most High: "... And as for those who can fast with difficulty, they have) a choice either to fast or) to feed a Miskin (poor person) (for every day)" is Abrogated by His saying: "... So whoever of you sights (the crescent on the first night of) the month (of Ramadan i.e. is present at his home), he must observe Sawm (fasts) that month"...
(25)
باب بَيَانِ نَسْخِ قَوْلِهِ تَعَالَى ‏{‏ وَعَلَى الَّذِينَ يُطِيقُونَه} فِدْيَةٌ بِقَوْلِهِ فَمَنْ شَهِدَ مِنْكُمْ الشَّهْرَ فَلْيَصُمْهُ
Sahih Muslim 1145 b

Salama b. Akwa' reported:

We, during the lifetime of the Messenger of Allah (ﷺ), in one month of Ramadan (observed fast according to our liking). He who wished to fast lasted and he who wished to break broke it and fed a needy person as an expiation 1544 till this verse was revealed:" He who witnesses among you the month (of Ramadan) he should observe fast during it" (ii. 184).
حَدَّثَنِي عَمْرُو بْنُ سَوَّادٍ الْعَامِرِيُّ، أَخْبَرَنَا عَبْدُ اللَّهِ بْنُ وَهْبٍ، أَخْبَرَنَا عَمْرُو بْنُ، الْحَارِثِ عَنْ بُكَيْرِ بْنِ الأَشَجِّ، عَنْ يَزِيدَ، مَوْلَى سَلَمَةَ بْنِ الأَكْوَعِ عَنْ سَلَمَةَ بْنِ الأَكْوَعِ، - رضى الله عنه - أَنَّهُ قَالَ كُنَّا فِي رَمَضَانَ عَلَى عَهْدِ رَسُولِ اللَّهِ صلى الله عليه وسلم مَنْ شَاءَ صَامَ وَمَنْ شَاءَ أَفْطَرَ فَافْتَدَى بِطَعَامِ مِسْكِينٍ حَتَّى أُنْزِلَتْ هَذِهِ الآيَةُ ‏{‏ فَمَنْ شَهِدَ مِنْكُمُ الشَّهْرَ فَلْيَصُمْهُ‏}
Reference : Sahih Muslim 1145b
In-book reference : Book 13, Hadith 192
USC-MSA web (English) reference : Book 6, Hadith 2548
  (deprecated numbering scheme)