There would probably need to be some sort of negotiated agreement in place.
The last time Israel tried that by itself (evacuating all settlements and complete pull-out from Gaza) it only led to an increase in attacks rather than an opening for peace. Buildings and other infrastructure (which were left intact after the Gaza pullout) were not re-used by Hamas. Instead they were destroyed.
But Gaza's leaders won't even agree to a permanent cease fire, let alone sit down to negotiate.
http://time.com/2984308/reports-hamas-armed-wing-rejects-egypts-ceasefire-plan/
After the beach incident, Hamas did allow for a 5 hour cease fire demanded by the UN, but had no interest in extending it. The minute the cease fire ended, Hamas forces had rockets in the air, aimed at Israeli cities.
Hamas sees Israel's request for a cease fire as a weakness, just as they saw the Gaza pullout as a weakness.
http://online.wsj.com/articles/israel-and-hamas-cease-fire-begins-to-allow-aid-into-gaza-1405585089
Israel's leaders have said more than once that they're willing to agree to a cease fire and negotiate a peace. Why doesn't Hamas do the same?
In all seriousness, if Hamas' leaders came out and said "We want to end the fighting permanently, let's talk." and stopped firing on Israel, does anyone believe that Israel would be able to do anything other than immediately come to the table?
The rocket fire is a convenient excuse for both Hamas and Israeli leaders because civilians on both sides see destruction. Remove that and their citizens (and the world) will force them into compromise.