I just did a pull from github and pulled from the wrong github repository into my project. How do I undo this?
Thanks!
git reset --hard HEAD^
This command resets your branch to the previous commit, that is the commit before the merge commit, which is the one you want to undo. Your work will be left untouched.
Remember that everything that has been commited is still there as loose objects and you can always use git reflog to revert to any version HEAD has pointed to before. This is why it's so important to commit often with git, you can undo all changes you have done with ease.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With