Easy... before you pull the current gear off, use a dremel/grease pen or something to make a small mark on the shaft and on the old gear to indicate its correct orientation. Then when you put the new gear on, line it up with the mark you made while comparing the old gear to the new in its relative orientation to the shaft.