Pin rack mechanism for reversing rotation