Story of Matsya Avtar
In the earliest yuga (era) of Sata-yuga, a king named Manu was performing severe penance for God. He was very kind and impassioned devotee of Lord Vishnu. One day when he was performing ablutions in river water, at the same time a small fish came into his hands. When he was about to throw the fish back into the river, the fish kindly requested the king to save its life.
After that King Manu took that fish with him as it requested and put that fish into a small jar of water but soon it grew and not able to accommodate in that jar therefore the King threw that fish into river. Again it outgrew the river and that river was also less for it to stay. Then last king threw it into river Gange it again started growing and became bigger. The king Manu was surprised and then realized that it must be Lord Vishnu and then last King threw that fish into the ocean.
The King Manu requested that fish for its real form or appearance then it ended a special request to the king. It predicted that in the seven days, the entire world would come to an end by a huge flood so it requested the king to make a huge boat. When that would be happened, you would take seeds of all plants, each kinds of animals and the seven sages (hermits) with you in that boat. When the big flood would be in out of condition, at the same time from my inspiration, he would be emerged in the form of a fish to propel that boat.
At last those words came true and exactly after seven days the flood occurred and all being were sunk into the water. Suddenly King Manu reminded that words of that fish and came near to the boat. Soon Lord Vishnu appeared and the king tied the boat to the fish by using the royal serpent “Vasuki”. King brought all of them to Mt Himavan and stayed here till the flood was over and in the new epoch (yuga), the king started reproduction for the new era.
This way, Lord Vishnu survived along with some "seeds of life" to restore life on the Universe in the incarnation of Lord Vishnu in Matsya Avtar .