Question: how does elena remember loving damon?
Answer: So, she makes the sacrifice, actually crossing over the line into Mystic Falls, willing to risk her life to end the compulsion just to remember Damon. However, he grabs her and pulls her back, saving her life. Again. The one thing she does remember is the water from the rain.