Reversing git pull

2

I made a Git Pull and overwritten everything I had in the code there.

In my company I used SVN and there I did an update after a commit and the system always performed a merge of everything, but the company migrated everything to git and it is already the second time that this happens to me.

I did a git pull before committing my changes, but what happened was that it did not merge the changes, git took everything the other dev.

Is there any way to revert to the previous state?

    
asked by anonymous 01.08.2016 / 16:51

1 answer

2

The most modern way to do this:

git merge --abort

And a slightly more correct way of doing this:

git reset --merge

The ways described before editing the answer would discard the local actions:

 git reset HEAD@{1}

Original answer here - SO-en

    
01.08.2016 / 16:56