Question

I have pulled data from a shared repository, but seems to be some errors on the remote. I can not fix his errors and commit back the code. I want to revert my code before pull and work on the feature on which I was working on.

Doing only git revert sha will work? I don't want to push my revert to the server.

What should I do?

Was it helpful?

Solution

git revert generates a new commit. Try to git reset --hard sha where sha is the commit id of your last working commit.

That will reset your HEAD to that commit and so deletes all following commits, which should be the commits you just pulled.

Caution: Can cause data loss on wrong usage.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top