daf bit: Bava Batra 6
In a section that could be characterized as "good fences make good neighbors", Rabbi Nachman says in the name of Rav Shmuel: if a man's roof adjoins another's courtyard he must make a parapet four cubits high, but between one roof and another he does not. Rabbi Nachman then disputes this, saying that a wall of four cubits is not required but a partition of ten hand-breadths is. Why? If the issue is "overlooking" then four cubits are required; if the issue is felonious entry by the neighbor then a mere fence of sticks is enough (to mark the border). The reason is the latter, but (because of the uneven ground?) the neighbor could find an excuse to trespass if it were only a fence of sticks (e.g. "I dropped something and fetched it"), but trespassing over a barrier of ten hand-breadths is actionable. (6b)
(I don't know what the ruling is if he really did drop something and want to retrieve it, as opposed to just using that as an excuse as indicated here. If his neighbor is home he can ask, but if he's not?)