If you unknowingly hole out and play another ball, or 10 more balls for that matter, and then discover you already had completed the hole with your first ball, the score for the original ball counts.