-
Notifications
You must be signed in to change notification settings - Fork 8
Answer to "How can I __revert__ a commit?" #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@@ -26,6 +26,14 @@ If you have any other questions not listed here, please raise a PR to have it ad | |||
|
|||
- Q: How can I __revert__ a commit? | |||
|
|||
`$ git commit -m "Something terribly misguided" (1).` | |||
`$ git reset HEAD~ (2).` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only surround commands by quotes, not the whole line. like git reset HEAD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you've learned a lot about reset
!
@@ -26,6 +26,14 @@ If you have any other questions not listed here, please raise a PR to have it ad | |||
|
|||
- Q: How can I __revert__ a commit? | |||
|
|||
`$ git commit -m "Something terribly misguided" (1).` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
single backticks for words or single lines
three backticks
surrounding multiple lines
for code blocks
@@ -26,6 +26,14 @@ If you have any other questions not listed here, please raise a PR to have it ad | |||
|
|||
- Q: How can I __revert__ a commit? | |||
|
|||
`$ git commit -m "Something terribly misguided" (1).` | |||
`$ git reset HEAD~ (2).` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strictly speaking this is a reset
. A reset
is a command to go back in time. a revert
would be undoing a single commit - I.e. applying a commit to the end of your commit history that does the opposite of the specified commit. That is, added lines become deleted, deleted lines are added.
Can someone help me make sure that each line is actually on a new line!
Thanks,
T