I am using github to store my code. I have committed a code which has errors and I am not able to correct it. Now I want to revert to earlier version of code which was working fine. Can someone please help me in getting back to old working code of mine.
Thanks
Pankaj
I assume from the way you’ve asked your question you’ve already pushed your changes to Github.
You can use
git revertto undo a commit. This doesn’t modify repository history, rather, it commits a change that is the opposite of your broken revision.If the commit that you want to remove is the latest one type
to undo it.
Replace
HEADwith the identifier of the broken commit if it isn’t the latest one. You can find the identifier in the output ofgit log.