The SKA will be a unique instrument with which to study the evolution of the gas content of galaxies. A proposed deep (~8 Msec) pencil-beam survey is simulated using recently updated specifications for SKA sensitivity and survey speed. Almost 10^7 galaxies could be detected in the redshifted 21cm line, most at redshifts in excess of two. This will enable confident statements to be made about the evolution of the cosmic HI density and the HI mass function to z=3, corresponding to a lookback time of 11 Gyr. However, galaxies or groups of galaxies with masses the same as the most HI-massive galaxies at z=0 will be detectable at redshifts of 6, if they exist. The ideal instrument for studying HI evolution would have an instantaneous sensitivity at least a factor of two higher than current specifications in the critical frequency range 200-500 MHz, or A/T > 2x10^4 m^2/K. The capabilities of the SKA will be highly complementary to ALMA which will be able to study the evolution of the molecular gas component over the same redshift range.