@nir
Looking at your picture, I only see 1 multi-pin connector disconnected. Did you have several disconnected and now not knowing what order they go?
Unless they are marked it will be difficult, to impossible with out a schematic.
Edit: The picture need an update. If you follow the wires, Coder P is connected with Pan (Yaw), Coder Y is connected with Tilt (=Pitch). I don't know why, chinese logic. Picture updated, color marks not touched.
Yea some connections have a black tar on them and all those go together. Then some have a blue marker either inside the female connector and also the joining male connector should have a blue matching mark. Then that leaves the set that have no markings and all those go together.