The Sages enacted the requirement to lean at certain points during the Seder, specifically, when eating the Masa and when drinking the four cups of wine. Although this law was enacted by the Sages, and is not required on the level of Torah obligation, the Sages found an allusion to this Halacha in the Torah. In the Book of Shemot, the Torah describes how after the Exodus G-d had the people circumvent certain regions, and it writes, "Va’yaseb Elokim Et Ha’am." The word "Va’yasab" may be viewed as related to the term "Heseba," suggesting that G-d had the people recline as an expression of their newfound freedom. As mentioned, however, this is merely an allusion, as the law was enacted by Hazal and is not a Torah obligation.
Although the obligation requires leaning only while eating Masa and drinking the four cups of wine, the Rambam (Rabbi Moshe Maimonides, Spain-Egypt, 1135-1204) writes that it is praiseworthy ("Hareh Ze Meshubah") to lean throughout the Seder, as well.
If one forgot to lean while eating the Masa, then he is required to eat Masa again in the proper position. According to the Peri Megadim (Rav Yosef Teomim, 1727-1792), such a person has not even fulfilled his Torah obligation of Masa.
This is true as well of one who drank one of the four cups of wine without leaning. Ashkenazim follow the lenient view that a person in such a case does not have to drink another cup, and this was also the view of some Sephardic authorities, including the Hida (Rav Haim Yosef David Azulai, 1724-1807). However, Hacham Ovadia Yosef (Hazon Ovadia – Responsa, 13), based on the ruing of the Shulhan Aruch (Orah Haim 472:7), writes that a man who had drunk one of the four cups of wine without leaning must drink an additional cup. If a person is not well, and it would be difficult or injurious to his health to drink an additional cup, then he may rely on the lenient position and not drink an additional cup of wine. Otherwise, however, one must drink another cup of wine if he mistakenly drank one of the four cups without leaning. This applies to all of the four cups.
For this reason, it is very important for the one leading the Seder to remind everybody in advance of the requirement to lean while eating the Masa and drinking the four cups of wine.
Summary: One must lean while eating the Masa and drinking all of the four cups at the Seder. If one did not lean while eating the Masa or drinking any of the four cups, he must eat an additional portion of Masa or drink an additional cup of wine, unless he is ill and this would be injurious to his health.