The invention discloses an automatic reversing mechanism, and belongs to the technical field of oil cylinder control devices. The automatic reversing mechanism solves the technical problem and achieves automatic reversing through the motion of piston rods of oil cylinders. According to the technical scheme for solving the technical problem, the automatic reversing mechanism comprises the first oil cylinder, the second oil cylinder, the third oil cylinder, the first piston rod, the second piston rod, the third piston rod and a manual reversing valve, a cylinder body of the first oil cylinder, a cylinder body of the second oil cylinder and a cylinder body of the third oil cylinder are all fixedly arranged, the second oil cylinder is arranged between the first oil cylinder and the third oil cylinder, the bottom end of the manual reversing valve is fixed, the manual reversing valve is a two-position four-way valve, and the manual reversing valve controls the motion direction of a second piston. The automatic control over the automatic reversing mechanism is achieved through the motion of the piston rods of the oil cylinders, and the explosion-proof security of equipment used under a mine is increased.