Possible Duplicate:
Git undo last commit
After using git commit , how can I discard this commit and revert to my original state?
After using git commit , how can I discard this commit and revert to my original state? |
|||||
marked as duplicate by nhahtdh, Greg Hewgill, bitmask, Simon, Michael Berkowski Jun 22 '12 at 2:20This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. |
|||||
|
Likewise, The Git Community Book is a great reference for learning to use git. |
||||
|
You can "undo" a commit like this using:
The files that you changed in the commit will remain modified in your working directory (see |
|||
|
If you want to discard all changes with no way of going forward, use:
Over here, HEAD is the ID of any of your previous commits. To roll back just one commit, get the commit id using:
And then use:
13cca2414skfrrrereaaa - is what the commit id might look like. |
|||||
|