If it's heated within a closed system (i.e. mains pressure hot water), the gases are still there - they can only leave the water if you have an open tank, which is a bit old-fashioned. You can observe this by running hot water into a glass from the faucet: it appears cloudy, which is the dissolved gases boiling off.
This means, once the hot water within the pipe has cooled (within the pipe) it'll still have the same gas content as cold water.
This means, once the hot water within the pipe has cooled (within the pipe) it'll still have the same gas content as cold water.