I'm looking for a game where the main character remember what happened in the first playthrough of the game

I'm looking for a game where the main character does different stuff in your first playthrough of the game and then remember this when you play your second playthrough of the game.

For example the character experience that someone dies in your first playthrough and after the person dies you find out how you could have prevented the death. You play the whole game until it's finished. When you then start the game again the character now remembers how you could prevent the death from happening and you manage to find the person who died on your first playthrough, but this time you manage to save that person from dying.

Anyone now know of a game like this?