Is it not the other way around? Fish had gills (as they do now) but in some areas where water was getting low, some developed legs and lost their gills, thus land animals came into existence, and we are descended from them? That's what they told me at school anyway.