The whole erasing of memories and time travel was a little hard to follow. I thought this YouTube comment helped a bit:
"A bit of translation help: The Japanese script mentions "Urashima Taro" instead of Rip Van Winkle when Rick gives Morty the serum. In Urashima Taro, a man saves a turtle from children that were toying around with it by putting it back in the ocean. A couple days later, that turtle comes back and takes him to an underwater palace to meet the princess there. The man and the princess spend a week together, but he has to go home to tend to his parents. Dismayed, the princess gives him a box and tells him never to open it. When the man returns home, everything is gone: his home, his parents, and everyone he knew. He ends up opening the box, and he becomes an old man.
So in this version, Rick and Morty go on a ton of adventures together (duh). When time's up, instead of a box containing old age, Rick gives Morty a serum containing all of his memories that turns him into Rick. Present Rick sacrifices himself to blow up the spaceship and thwart Evil Morty (who is the Morty who didn't take the serum). Present Morty takes the serum that turns him into Rick right up until future Morty is born. Rick and Morty go on a ton of adventures together again. "