I host my files on bitbucket and normally commit changes every now and then.
Since my last commit, I have made some mistakes in my code.
(These mistakes have been saved in their respective local files and I haven't added it to the local git repo just yet using git add.)
I would like to revert back to my last commit with the working code. I am currently working on a branch off the master.
What command should I use for this?
git reset --hard will revert all files to HEAD.
I prefer this to git checkout -- . but that's just a matter of preference.
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