Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).`
Copy link
Member

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

`$ git reset HEAD~ (2).`
Copy link
Contributor

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

Copy link
Member

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.

`<< 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`?
Expand Down