How to know the hard disk capacity for sure and how to recover lost partitions? After I have played with boot camp, the disk became only 250 GB out of 500 GB.
disk utility, terminal, and system information are showing that disk capacity is 250 GB.
Although I am sure that the disk is originally 500 or to be precise I am sure that those same programs displayed 500 before, I'd like to know how can I know the real capacity for sure and of course is there any solutions to undo whatever I did that corrupted the disk.
Apple exposes the hardware size of the drive in several places.


About this Mac in the Apple Menu - click storage tab
System Information app (click System Report... in About this Mac - overview section)


there's a storage general category 
there's specific storage details (firmware / bus position / bus speed) for the SATA / AHCI / NVMe section based on how your storage is physically connected to the hardware

Disk Utility (in /Applications/Utilities)


The undo is either finesse the partition table (there are hundreds of questions here on how to change gpt and diskutil or to backup your files, and erase install a new OS which basically boots to another recovery OS and runs Disk Utility to repartition / erase the drive.

Good luck with your choice of path to get the storage back and set.