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.
Stability of the aircraft has nothing to do with control surfaces or moving CG to control the aircraft (that kind of aircrafts are very rare anyways). When researching or testing for aircraft's stability, control surfaces are either fixed to neutral position or they let alone to float freely, so control surfaces are not used to make aircraft more stable. That's of course true for conventional aircraft.
On the other hand you can produce an unstable or neutrally stable aircraft, however in that case you are required by regulations and nature to use some kind of control computers to keep aircraft in control all the time. MD-11 and Boeing 777 are two examples of this. Even though they are not unstable nor neutrally stable, they are definitely less stable than the requirements for the conventional aircrafts. To get away with that they have to have couple of flight control computers to keep the aircraft sane. However, even when the automation fails these aircrafts still have some positive static stability. How far you can go towards unstable side depends on design choices. You can further read Peter's post about why there is really less bang for buck when you further decrease the stability.
When statically stabil aircrafts are disturbed by any outside or inside forces (gusts, hitting control column etc) it creates a restoring moment which returns aircraft to its initial position. That makes aircraft easier to fly. Unstable aircrafts however tends continue to move in the direction of disturbance. So if a gust hits the aircraft and increases the AOA slightly, the aircraft continues to increase its AOA by itself and snap out of control eventually. That’s why you need flight control computers to stop any uncommanded movements.
The picture you show illustrates a neutrally stable aircraft, which means that it does not show any reaction to disturbances and maintains its disturbed position. Some aircrafts are designed that way to increase its maneuverability, reduce trim drag and increase fuel efficiency. Check out that link for a comparison of stable and unstable fighter aircrafts and how they behave during maneuvers. Some of these aircrafts are dubbed under different names such as relaxed static stability instead of calling them unstable or neutrally stable aircrafts in order not to freak out the masses.
Stability of aircraft is very closely related with CG position. As a general rule moving CG forward makes it more stable and moving aft makes it less stable and eventually unstable if gone out side of CG limits. Normally you won’t intentionally move CG out of limits but there are accidents which caused that. For example in this Boeing 747 accident at Bagram, payload got loose and moved aft of the aircraft uncontrollably during takeoff and aircraft become extremely unstable that no control input would be able to recover it.
These all are static stability. The dynamic one is another beast.
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.