If you messed up your code and you want to revert the changes you made, you can use git reset --hard [commit] where [commit] is the "commit hash" you want to go back to. The files of the working directory and the staging area will be reset to ...

Markdown supported · ⌘↵ to post
I prefer to use some Git GUI client for those change, I do not want to mess with things any further.
Ghost
Self-employed software developer, artist, writer.
Sometimes I need to use this at work, I've made a fair share of accidental commits.