  (abridged) Studies of distant galaxies have shown that ellipticals and large
spirals were already in place 8 Gyr ago, leading to a very modest recent star
formation in intermediate mass galaxies. This is challenged by a recent
analysis (Heavens et al. 2004) of the fossil record of the stellar populations
of ~10^5 nearby galaxies, which show that intermediate mass galaxies have
formed or assembled the bulk of their stars 4 to 8 Gyr ago. Here we present
direct observational evidence supporting the Heavens et al's findings from a
long term, multi-wavelength study of 195 z>0.4 intermediate mass galaxies,
mostly selected from the CFRS survey. We show that a recent and efficient star
formation is revealed at IR wavelengths since ~15% of intermediate mass
galaxies at z>0.4 are indeed luminous IR galaxies (LIRGs), a phenomenon far
more common than in the local Universe. The star formation in LIRGs is
sufficient in itself to produce 38% of the total stellar mass of intermediate
mass galaxies and then to account for most of the reported stellar mass
formation since z=1. The high occurrence of LIRGs is easily understood only if
they correspond to episodic peaks of star formation, during which galaxies are
reddened through short IREs (infrared episodes). We examine how galaxy IREs can
be related to the emergence at high redshift, of the abundant population of
galaxies with small size, blue core and many irregularities. We show that
recent merging and gas infall naturally explain both morphological changes and
episodic star formation history in a hierarchical galaxy formation frame. We
propose a simple scenario in which 75+-25% of intermediate mass spirals have
experienced recently their last major merger event, leading to a drastic
reshaping of their bulges and disks during the last 8 Gyrs.
