You're out on the golf course, and you're getting ready to hit the ball. You stand just to the side of the ball, and you take a practice swing before getting ready to hit your shot for real.
Whoops. While you're taking your practice swing, you actually hit your ball. After your playing partner obnoxiously yells, "That's a stroke!" and you get over the initial embarrassment, then you wonder: Does that practice stroke count as a real stroke?
The answer, according to the Rules of Golf, depends on where the practice stroke was made.
If a golfer hits the ball with a practice swing when the ball is teed up or before the first shot of a hole, then the stroke doesn't count and the golfer can replace the ball to hit it again without penalty. That's because, under the Rules of Golf, a ball is not considered in play on a hole until the tee shot has been struck.
However, once the tee shot on a hole is struck, the ball is in play until it is holed. From after the tee shot to when the ball is holed, when a golfer hits a practice stroke that hits the ball, the golfer actually incurs a one-stroke penalty. The player has to take the penalty, pick up the ball, put it back where it was, and then hit the ball as they would have intended.
To be frank, most golfers in that situation would just play it off as though they just hit a bad shot and go on with it. Having to pick up the ball and put it back with a penalty stroke is just adding insult to injury.