Unfortunately neither of those circuits will work.
In the first, the lower nmos fet will merely short out the motor. Your fets are only half of an H-bridge. Google for an explanation.
In the second, there is no way of unlatching the relays. A latching relay has either dual coils (one for set, one for reset, as in the Chrisatronics circuit) or a single coil which must be enrgised by reversing the polarity of the voltage across it. The Chrisatronics article explains this.
In the first, the lower nmos fet will merely short out the motor. Your fets are only half of an H-bridge. Google for an explanation.
In the second, there is no way of unlatching the relays. A latching relay has either dual coils (one for set, one for reset, as in the Chrisatronics circuit) or a single coil which must be enrgised by reversing the polarity of the voltage across it. The Chrisatronics article explains this.
How the micro treats signals from the limit switches is up to you as the programmer. You could just tell it to stop the motor then reverse the motor direction so that the switch will be reset at a later moment.my question is if i then reverse this process to make the motor reverse will it not just keep cancelling itself out because input 9 is still high?