Why did I gain

After I ate and brushed my teeth last night, I checked my weight, it went down. I just checked it again, I didn't eat or drink anything after that last night and I gained so much just by sleeping. How did that happen?