I think this is the rule you're looking for:
24-1. Movable Obstruction
A player may take relief, without penalty, from a movable obstruction as follows:
a. If the ball does not lie in or on the obstruction, the obstruction may be removed. If the ball moves, it must be replaced, and there is no penalty, provided that the movement of the ball is directly attributable to the removal of the obstruction. Otherwise, Rule 18-2a applies.
b. If the ball lies in or on the obstruction, the ball may be lifted and the obstruction removed. The ball must through the green or in a hazard be dropped, or on the putting green be placed, as near as possible to the spot directly under the place where the ball lay in or on the obstruction, but not nearer the hole.
The ball may be cleaned when lifted under this Rule.
When a ball is in motion, an obstruction that might influence the movement of the ball, other than equipment of any player or the flagstick when attended, removed or held up, must not be moved.
(Exerting influence on ball - see Rule 1-2.)
Note: If a ball to be dropped or placed under this Rule is not immediately recoverable, another ball may be substituted.