There are many choices he could make. He could still pursue military action against Hamas. Find Haniyeh, Deif, Sinwar, Mashal and others and send a hit squad to kill them. Freeze their assets. There is no excuse for bombing civilians though. It is not a solution, he is creating more problems.
I wouldn't give a flying fuck if this was only Hamas that was taking the ass kicking. But the ones on the receiving end are mainly children, women, old people and other innocent civilians.
There is no version of this, that will prevent terrorism.
You attack them, you will have terrorism. In the future there will be a bigger terror attack. Israel is not the US, they have a geographical disadvantage. So it will keep happening until it is resolved diplomatically.