Git: some changes weren't reversed by `git reset --hard HEAD`

42 Views Asked by At

I made changes in my project, then did git reset --hard HEAD, but I notice that some of the changes are still present. When I run git status I get Your branch is behind '<my branch>' by 1 commit, and can be fast-forwarded.

Can anyone explain this message, and advise me on how to approach it so that I can undo all the changes that I made after my previous commit?

1

There are 1 best solutions below

0
Piotr Ostrowski On

In order to go back one commit and overwrite the remote, you can

git push --force

Provided that you are happy with the state of your repository on your local machine. Otherwise, just git pull to fast-forward.