Rewind to a Specific Commit
As a developer, you may need to undo changes made to your codebase. For example, you may have made a mistake and need to go back to an earlier version of your code. In this challenge, you will use Git to rewind back to a specific commit in a repository.
Tasks
To complete this challenge, you will use the Git repository git-playground
from https://github.com/labex-labs/git-playground.git
.
- View the commit history of the repository.
- Make sure that the commit message you want to rewind to is the "Initial commit" commit hash.
- Rewind back to the commit hash.
- View the commit history of the repository again.
This is the result of running git log --oneline
:
c0d30f305 (HEAD -> master) Initial commit