The History brush (Y) paints back the photo as it looked at an earlier moment, only where you paint. Use it to take an adjustment, a filter or a retouch away from part of the photo.
Paint back chooses the moment: As opened, or just before any step in History. From a version… opens Version history; the brush button on a saved version paints back from that version.
It paints on the chosen paint layer, or a new History brush layer at the top, so what it brings back looks exactly as it did and the photo itself never changes. Size, Hardness, Strength and a selection work as with the other brushes.