They look at your whole transcript so they will see both. However, they will only count the most recent retake towards your GPA.
True Story: I retook Multivariable Calculus four times. 3x I got a D+ or worse (this was early on in college, when I didn't know what the hell I was doing), and the last time I got a B.
I wasn't ever asked about it.