I understand that the disturbance was caused by either the CG moving too ahead or too rear, or the CP moving forward of the CG. I would like to know that in the given image, how did the aircraft hold the disturbed orientation ? Was it perhaps by mechanically shifting the CP back again using some device ? Thanks in advance.
Your own answer is correct. You "mechanically shift the CP (in relation with CG)" with a control surface.
Perhaps this is easier to see on the roll axis, where we use ailerons to laterally shift the aerodynamic CP. If the plane has dihedral, it will try to roll back up right, if not, it will remain in a bank, similar to your picture.
As a note to those "dihedral unbelievers", yes, a strong yawing or spiralling tendency will cancel dihedral stability, but that is an issue of the rudder.
A plane with "nuetral stability" stays where it is after control input or "external disturbance" is removed.