Which Garmin and what did you upload your data too? The Garmin 500, 705 and 800 (and maybe others) use barometric pressure for elevation gain/loss which can have some drift due to ambient pressure changes and sensor drift. Usually sites you upload your data to have an option to correct it for known elevations along your ride. If you click this option, it adjusts the Garmin data to coincide and can improve accuracy.