Encouragement needed

I didn't weigh before I started my diet on June 15th. But from June 15th to yesterday I have lost 11 inches and a pant size but when I weighed today it said I gained 20 pounds and I'm just at a loss for words.