diff --git a/README.md b/README.md index 47c329b..d7b8f1a 100644 --- a/README.md +++ b/README.md @@ -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).` +`<< 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`?