A Wizard prepares a number of spells equal to his Wizard level + his Intelligence modifier.

But what happens if he loses Intelligence (the most obvious way I can think of is unattuning to a Headband of intellect and having a base Intelligence score of less than 18) after preparing his spells? Does he...

1. Lose access to the first [INT mod lost] spells he prepared?
2. Lose access to the last [INT mod lost] spells he prepared?
3. Randomly lose access to [INT mod lost] of the spells he prepared?
4. Keep access to all his prepared spells (but will be able to prepare fewer spells after his next long rest, unless he regains the lost intelligence)?