Shevi'is, Chapter 3, Mishnah 10. This mishnah discusses one who wishes to build a fence during the Shemittah year, and the question of what may be done with the soil dug out for the construction.
"HaBoneh gader beino uvein reshus harabim - mutar leha'amik ad hasela":
One who wishes to build a fence between his field and the public domain may dig for the foundations of the fence and go as deep as the hard rock, and we do not limit the depth of his digging.
At first glance there would seem to be reason for concern that one who digs during Shemittah looks like someone digging in order to plant. But this is not the usual practice - a person does not plant between his field and the public domain - and therefore there is no suspicion here, and he is permitted to dig down to the rock.
"Mah ya'aseh be'afar?":
Regarding the soil that he removed from the excavation, the Tannaim disagree:
"Sovro bireshus harabim u'maskeno" - the words of Rabbi Yehoshua: "Sovro" comes from the word sibbur, meaning that he piles up and gathers the soil. According to Rabbi Yehoshua he piles the soil in the public domain and uses it to improve it: he makes mounds of it, and gradually fills in the potholes in the public domain.
Rabbi Akiva disagrees: "Kederech she'ein mekalkelin reshus harabim, kach lo yesaknu": Just as a person may not create damage or an obstacle in the public domain, so too he may not carry out improvements there. The matter is not entrusted to him, and he has no right to do it. Just as we do not want him piling soil in the public domain, so too we do not want him filling in the potholes with it.
"Sovro besoch sadehu kederech hamezablin":
According to Rabbi Akiva he piles the soil inside his own field, in the same manner practiced by those who fertilize - in the way we learned above, that a person may bring manure out to his field and pile it in three large heaps. Here too he follows that very same practice.
"Vechein hachofer bor v'shiach um'arah":
The law is the same for every excavation - a cistern, a ditch, a cave, or any hollow in the ground: he leaves the soil inside his own field. And during the Shemittah year he does so by means of the three heaps, and in this way he does not appear to be improving his field.
In summary: In this mishnah we learned that one who builds a fence between his field and the public domain may dig down to the rock, since there is no suspicion that his digging is for the sake of planting. Regarding the soil, Rabbi Yehoshua holds that he piles it in the public domain and uses it to fill in the potholes, while Rabbi Akiva holds that just as one does not damage the public domain, so too one does not improve it, and therefore he piles the soil inside his own field in the manner of those who fertilize. The same law applies to one who digs a cistern, a ditch, or a cave.