I have git setup on my web hosting and on an account at Bitbucket which are both linked.
How can I revert back to my first commit on both my hosting (which I am logged into via SSH and has git installed ready and working) and on Bitbucket?
I have tried: git checkout 965a793
Then I tried with a dot on the end: git checkout .
but nothing seems to change on the Bitbucket side, when I got to git push. It says everything is up to date, even though Bitbucket is on commit cf08232
Here is a list of my three commits:
cf08232 remove the txt file
096d08f test.txt edited online with Bitbucket
965a793 Initial Commit
If we execute git checkout myquote2. html The repository will restore myquote2. html to the previously committed version. Alternatively, we can execute git reset --hard which will revert the whole repository to the last commit.
Use --force :
git reset --hard commitID
git push origin branchName --force
I am assuming origin is the remote of bitbucket
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