There's a full English translation here [1] with details on Ibsens likely sources of inspiration, if you want to read it. It feels a lot longer when you're 9-10 years old...
But here's a summary of the end:
He is released from prison at the end of the Napoleonic wars, and comes home to find his wife and child died while he was in prison, and were buried in a paupers grave.
Years later he comes across a ship in distress and it is the captain of the British ship that caught him, with his family. He threatens revenge, but on picking up the child changes his mind and saves all of them.
But here's a summary of the end:
He is released from prison at the end of the Napoleonic wars, and comes home to find his wife and child died while he was in prison, and were buried in a paupers grave.
Years later he comes across a ship in distress and it is the captain of the British ship that caught him, with his family. He threatens revenge, but on picking up the child changes his mind and saves all of them.
[1] http://www.oftebro.com/Terje_Vigen_english.pdf