I met a similar problem.
The solution is to use git log
to look up which version of the local commit is different from the remote. (E.g. the version is 3c74a11530697214cbcc4b7b98bf7a65952a34ec
).
Then use git reset --hard 3c74a11530697214cbcc4b7b98bf7a65952a34ec
to revert the change.