Evolution of cosmic magnetic fields: From the very early Universe, to recombination, to the present