-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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).` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only surround commands by quotes, not the whole line. like
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strictly speaking this is a |
||
| `<< edit files as necessary >> (3).` | ||
| `$ git add ... (4).` | ||
| `$ git commit -c ORIG_HEAD (5).` | ||
| `comment from: https://stackoverflow.com/questions/927358/how-to-undo-the-most-recent-commits-in-git.` | ||
|
|
||
|
|
||
| - Q: I keep accidentally adding files I don't want to commit (e.g. compiled code, files with passwords etc.), how can I __ignore__ these files? | ||
|
|
||
| - Q: What's the difference between `git pull` and `git fetch`? | ||
|
|
||
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