There's no penalty for accidentally moving your ball on the putting green, or while you're searching for it or trying to identify it. In those cases you put the ball back on its original spot.
Elsewhere, causing your ball at rest to move usually costs one penalty stroke under Rule 9.4b, and you replace it. There are exceptions, such as accidental movement while marking, lifting or replacing the ball when allowed, or while taking relief.
How Golfers Say It
"Stepped on it looking for it, that's free now."
"Ball moved when I grounded my putter, just put it back."
"In the fairway that's a stroke, replace it."
Origin
The 2019 Rules removed the penalty for accidentally moving your ball on the putting green and during a search. Rule 7.4 counts reasonable actions to find a ball, like sweeping your feet through long grass or shaking a tree, as accidental.
Rules & Context
If you move it during a search, replace it on its original spot, and estimate the spot if you don't know it. If it was covered by sand, re-create the lie, though you may leave a small part of the ball visible.
Neil's Take
“
Searching in deep rough is stressful enough. If you nudge your ball while looking, put it back and keep playing.
Frequently Asked Questions
Is there a penalty if I move my ball while searching?
No. Put it back on its original spot.
What about on the green?
No penalty for accidental movement on the putting green either.
And in the fairway?
Usually one penalty stroke under Rule 9.4b, and you replace the ball.
Sources: R&A, Rules of Golf (Rule 9) · R&A, Rules of Golf (Rule 7) · R&A, Rules of Golf (Rule 13) · Golf Monthly, New Golf Rules 2019