As suggested in "Wood Fences" (page 30), a gate's hinge post should be buried the greater of 3' or one-third of its length deep in the ground and anchored in packed dirt.
Easiest to install and adjust are eye and pintle sets that simply screw into pilot holes drilled into the gate's hinge-side stile and hinge post. The eye goes into the post, the L-shaped pintle into the gate, and the eye simply slips down over the pintle--and and can easily be removed if necessary.
At top, bottom, and middle of the stile, insert 3" shingle splits from each side, between stile and post; push together so that the stile is immobilized and wedged tight parallel to the hinge post. Attach the stile to the post with hinges.
If it does, push the vertical post back in position, then use "L" brackets and screws to reconnect this hinge post
to the horizontal 2x4 as shown.