סימן קפג סעיף ב
אֲפִלּוּ מִי שֶׁבָּא אֵיזֶה נֶזֶק עָלָיו, אָסוּר לְסַלְּקוֹ מֵעָלָיו, אִם עַל יְדֵי זֶה יִגְרוֹם שֶׁיָבוֹא עַל חֲבֵרוֹ, כִּי אָסוּר לְהַצִּיל אֶת עַצְמוֹ אֲפִלּוּ בִּגְרַם נֶזֶק מָמוֹן שֶׁל חֲבֵרוֹ. אֲבָל קֹדֶם שֶׁבָּא הַנֶּזֶק עָלָיו, מֻתָּר לִדְחוֹתוֹ שֶׁלֹּא יָבוֹא עָלָיו, אַף עַל פִּי שֶׁעַל יְדֵי זֶה יָבוֹא עַל חֲבֵרוֹ. כְּגוֹן אַמַּת הַמַּיִם שֶׁבָּאָה לִשְׁטֹף שָׂדֵהוּ, עַד שֶׁלֹּא נִכְנְסָה לְשָׂדֵהוּ, מֻתָּר לִגְדֹּר בְפָנֶיהָ, אַף עַל פִּי שֶׁעַל יְדֵי זֶה הִיא שׁוֹטֶפֶת שְׂדֵה חֲבֵרוֹ. אֲבָל מִשֶּׁנִּכְנְסָה לְשָׂדֵהוּ, אָסוּר לְהוֹצִיאָה בְעִנְיָן שֶׁתַּגִּיעַ לִשְׂדֵה חֲבֵרוֹ, שֶׁכֵּיוָן שֶׁהַנֶּזֶק מֻטָּל עָלָיו, אֵינוֹ רַשַׁאי לְסַלְּקוֹ מֵעָלָיו וּלְהַטִּילוֹ עַל חֲבֵרוֹ.
Even if you sustain a loss, you are forbidden to remove the cause of your damage if by doing so you will cause damage to your neighbor, for it is forbidden to salvage your property by causing damage to another even indirectly. However, before the damage is done to you, it is permitted to forestall it so that it doesn't occur, even though by doing so, it will cause a loss to your neighbor. For example, if a stream of water is threatening to flood your field, before the water reaches your field, you are permitted to construct a dam in its path, even though this will cause it to flood your neighbor's field.1Yerushalmi. But if the water had already entered your field, you are forbidden to divert it to your neighbor's field. For since the damage has already occured, you are not permitted to divert it from your field, and direct it to your neighbor's field.
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)