Target fell out of favor with consumers, but it has started to get back on track, and investors have taken notice.