Shulchan Arukh, Orach Chayim Siman 348
Can copy this into an AI, or connect the whole library to your assistant. For deeper learning, you can directly use the original seforim, sites, and apps.
היה עומד ברשות היחיד והוצי' ידו מלאה פירות לרשות הרבים בתוך עשרה בשוגג מותר להחזירה לאותו חצר ואסור להושיטה לחצר אחר ואם במזיד אסור אפי' להחזירה לאותו חצר ויש אומרים דהני מילי כשהוציא' מבעוד יום אבל אם הוציאה משחשיכה מותר להחזירה שמא ישליכה מידו ויבא לידי חיוב חטאת במה דברים אמורים כשהוציאה לרשות הרבים אבל אם הוציאה לכרמלית בכל גוונא מותר להחזירה:
If someone was standing in the private domain, and he extended his hand full of fruit to the public domain less than ten tefachim from the ground; if he did it by mistake, he is permitted to return his hand to the original yard and is forbidden from extending his hand to another yard, but if he did it on purpose, he is forbidden even from returning it to the original yard. There are some who say that this refers to when he extended his hand on Friday while it was still daytime, but if he extended his hand once it was dark, he is permitted to return it, lest he drop some fruits and be liable for a sin offering. What specifically is being discussed? When he extends his hand to the public domain, but if he extends it to the karmelit, he is permitted to return it in every situation.