Sometimes when you've committed your work - you instantly remember, that you forgot something.
You didn't add all the files!
You didn't put in the right commit message
you're simply not done.
...
It would be nice to have command git undo you could run to undo the most resent commit.
Go and investigate what git command can help you to achieve this and then add the undo alias to the .gitignore file you created in the root of the repository in one of the previous issues.
What could go wrong? Consider:
What happens if you undo a commit that is already pushed to GitHub?
Can you use this command to undo a commit that isn't your own?
Sometimes when you've committed your work - you instantly remember, that you forgot something.
You didn't add all the files!
You didn't put in the right commit message
you're simply not done.
...
It would be nice to have command
git undo
you could run to undo the most resent commit.Go and investigate what git command can help you to achieve this and then add the
undo
alias to the.gitignore
file you created in the root of the repository in one of the previous issues.What could go wrong? Consider:
What happens if you
undo
a commit that is already pushed to GitHub?Can you use this command to
undo
a commit that isn't your own?