Taking my inspiration from you I planted my tomatoes, peppers, and corn in pots. Every afternoon I have been lugging them into the house because of the chance of hail or even worse tornadoes. Unfortunately my zucchini are in raised beds and they are waterlogged. Several developing little zucchinis have gone mushy and have fallen off.
More rain is forecasted for this weekend so the plants are staying put in my living room.
Yes, pots/containers gives one several advantages and that is one of them - you can move them for the best advantage for them and in your case it was saving their lives by moving them inside.
Another advantage is you grow them in good potting soil so you don't have to deal with “dirt/ground”, trying to get the dirt/ground to support growing the plant PLUS YOU DON'T HAVE TO WORRY ABOUT THE MURDERING BUGS IN THE DIRT/GROUND.
When murdering borers killed my three squash plants I planted in dirt, totally killing them in three days, that was it for me - no dirt growing/murdering bugs again.
And, watch for murdering SQUIRRELS - shoot them! Send them to Johnny as he has a recipe for dead squirrels. :o)