The Rules of Golf provide different guidelines depending on where accidental ball movement occurs during a practice swing: on the tee, putting green, or elsewhere on the course.
On the tee: When you are playing from the teeing area, the ball is not considered in play until a stroke is made. This means that if you accidentally strike and move your ball with a practice swing, it has not been counted as a stroke or a ball in play. In such cases, the Rules allow you to re-tee the same ball or another ball without penalty. This applies even after starting the hole, such as if your initial shot goes out of bounds or ricochets back into the teeing area. These situations are covered under Rules 6.2b(5) and 6.2b(6). It’s important to note that the “teeing area” is defined as the two club-length-deep section behind the designated tee markers, not the entire tee box.
On the putting green: Similarly to the teeing area, if your ball is accidentally moved during a practice swing on the putting green, you are allowed to replace the ball on its original spot without penalty. This is covered under Rule 13.1d(1).
Anywhere else: In other areas of the course, including the general area (anywhere on the course that is not the teeing area, putting green, bunkers, or penalty areas), your ball is in play once it has been placed or hit. If you accidentally move the ball during a practice swing in any of these locations, it is not counted as a stroke. However, you will receive a one-stroke penalty for moving a ball in play, and you must replace the ball in its original spot. If the player plays the ball from the new position where it was moved after the practice swing, it results in a two-stroke penalty (or loss of hole-in-match play). Whether the player is required to correct this mistake depends on Rule 14.7.
Example: A player takes a practice swing on the fairway and accidentally moves their ball. The player must replace the ball on its original spot and take a one-stroke penalty. If the player instead plays the ball from where it was moved, they incur a two-stroke penalty.