I found some questions about how to revert with Git, but those questions always needs human interaction or to need to which revision are you going to revert. In this case there is no human interaction and you are not telling the machine to which revision must revert.
Given a remote and automated machine which haves a cloned git repo which does pull every time you press a "pull" button on it's interface, is it possible to implement the functionality of reverting to the previous commit?
I can easily add the button, but I'm not sure about how to do the functionality. I mean, i need to know if git has a command which gives you the previous commit of it's branch and then, a command which changes the local repo status to that previous commit.
This machine doesn't make any commits, it only has the clone code and it only does some pull for code updating. Now with this new button it will be capable of reverting to the previous revision.
Is this possible?