Mishnah 7 in chapter 13 of Maseches Menachos parallels the structure of the previous mishnah: there we dealt with someone who obligated himself to bring an olah, and here the mishnah deals with someone who obligated himself to bring shelamim or a todah - and the todah is really a sub-category of shelamim.
The difference between the olah and the shelamim:
Shelamim is the other type of animal offering a person can pledge and bring, but there is no bird offering brought as shelamim at all: a bird comes only as an olah or as a chatas.
Unlike the olah, shelamim may come from a male or from a female alike.
The twelve possibilities:
Three species of animal are brought as shelamim - cattle, goats and sheep - and each of them may be male or female, mature or young. We therefore have twelve possibilities before us:
Cattle: a bull - a male ox in its second or third year; a cow - a mature female; a calf - a young male; a heifer - a young female.
Goats: a sa'ir - a mature male goat (a he-goat); a se'irah - a mature female goat; a gedi - a male goat that is not yet mature; a gediyah - a female goat that is not yet mature.
Sheep: a ram - a mature male, thirteen months and one day old; a ewe - a mature female; a lamb - a young male sheep; a talya - a young female sheep.
"Harei alai todah u'shelamim" - one who obligates himself to bring a todah or shelamim without specifying which type of animal he will bring may bring any of the species, since they are all included in his words. He may therefore bring the cheapest of the possibilities - a small lamb - and thereby fulfill his obligation.
"Pirashti min habakar v'eini yodea mah pirashti" - one who says that he vowed a particular type from the cattle but does not remember which type he vowed must bring all four of the cattle possibilities: a bull and a cow, a calf and a heifer.
"Minah beheimah" - one who says that he vowed a particular type of animal but does not remember which type it was must bring all twelve possibilities, in order to be certain that he has fulfilled his obligation: "he brings a bull and a cow, a calf and a heifer, a ram and a ewe, a gedi and a gediyah, a sa'ir and a se'irah, a lamb and a talya." (It is worth noting that the order of the listing in the mishnah is not consecutive: after the ram and the ewe, which are mature sheep, the mishnah returns to the goats.) This mishnah follows the opinion of Rabbi, and the halachah does not follow it.
The halachah in practice:
No dissenting opinion is brought in the mishnah itself, but the Gemara explains that the Rabbanan disagree and hold that the mature animal includes the young one within it: one who obligated himself to bring a calf can bring a bull and fulfill his obligation with it. The male and the female, however, cannot substitute for one another. It emerges that twelve animals are not needed, but only six:
From the cattle - a bull and a cow.
From the goats - a sa'ir and a se'irah.
From the sheep - a ram and a ewe.
The other six - a male calf and a female calf, a male kid and a female kid, a male lamb and a female lamb - are all included within those six mature animals.
Summary: In this Mishnah we learned the laws of one who obligates himself to bring a shelamim or a todah without specifying which type of animal. We saw the difference between the olah and the shelamim - that a bird is never brought as a shelamim, and that the shelamim may be either male or female - as well as the twelve possibilities contained in the three species. One who vows without specifying brings the least expensive of them; one who specified "min habakar" - from the cattle - and does not remember, brings all four types of cattle; and one who said "minah behemah" - that its species is an animal - and does not remember, brings, according to Rabbi, all twelve. In practice, however, the halachah follows the Rabanan: the mature animal includes the young one, and six animals alone suffice.