In the case where one pulls from a repository such as GitHub and something breaks, one may want to undo that pull. Here are the steps to rollback to a previous version using Git.
Note if you have any work in the local working directory done after the pull, it will be lost using this method.
Our goal is to move to the Head to the last snapshot before the pull and return the Zen to us.
Steps
- Find the SHA-1 version using reflog. The reflog is interactive and one uses a q to exit out.
Read full article from Git: Rollback (or Undo) a Pull from an External Repository To Return To A Previous Stable Commit State « OmegaMan's Musings
No comments:
Post a Comment