I understand it is possible to delete everything locally and just start fresh but I wonder if there is an easier way when you do not require to keep anything done locally using git commands.
for example if I added bunch of files locally that I would like to remove and just download the latest master copy.
Please note: Reading the other questions (there are many; I read them before posting), git help & blog posts I wasn't sure if it's going to reset my repository or not which is why I posted this question; I imagine someone with the same exact issue might want to validate and that's what I have done through comments. and that is why I don't think its a duplicate although it might have the same response.
To remove the git commit which you have added locally do:
git reset --hard HEAD^
To remove the remove the uncommitted files, do:
git clean -fd
check out other git Clean options here:
https://git-scm.com/docs/git-clean
and then do
git fetch
git rebase origin/master
or
git pull
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