Sounds like he had a brief bout of bloat, common in betta's.
He was more than likely over feed, given too much protein, or given freeze dried foods that swelled (you didn't state your food type so I can't be completely sure exactly what).
I really recommend keeping frozen brine shrimp on hand and offering it regularly. It has a laxative like effect, much like peas with goldie's, that can help cure and prevent back ups and blockages that can cause bloating and swim bladder disorders.
Best of Luck!