The origin of a recently reported peculiar phenomenon-polarization reversal against the applied electric field in ferroelectric thin films [M. Aplanalp and P. Gunter, Ferroelectrics 258, 3 (2001), T. Morita and Y. Cho, Appl. Phys. Lett. 84, 257 (2004)]-has been identified. The phenomenon is observed when poling a ferroelectric film with a large electric field applied to a conductive tip of an atomic force microscope (AFM). The effect seems to be of quite general nature as it has been observed on BaTiO3 [Aplanalp , Phys. Rev. Lett. 86, 5799 (2001)] as well as on LiTaO3 films [I. Morita and Y. Cho Appl. Phys. Lett. 84, 257 (2004)]. It was proposed that this switching is provoked by mechanical stress due to the Maxwell force between tip and bottom electrode [Aplanalp , Phys. Rev. Lett. 86, 5799 (2001)]. We have studied the same phenomenon in PbZr0.4Ti0.6O3 (PZT) thin films, deposited as epitaxial film on conductive, Nb-doped SrTiO3 single crystals. New experimental evidence strongly supports a different explanation. The poling process is accompanied by considerable charge injection leading to important space charges inside the ferroelectric film. These charges finally can lead, for given conditions, to a polarization reversal when the applied voltage to the conductive AFM tip is set to zero. Two analytical models are proposed to explain field inversion in the upper part of the film.