Reversal of git pull

Asked

Viewed 808 times

2

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

In my company we used SVN and there I would update a commit and the system would always merge everything, but the company migrated everything to git and this is the second time that happens to me.

I performed a git pull before committing my changes, but what happened was that it didn’t merge the changes, git took everything the other dev.

Is there any way to revert to the previous state?

  • Did you get the pull in the middle and make mistakes or get clean and erase what you had?

  • Deleted my local changes and replaced them to the server ones, and since I didn’t commit before it doesn’t come back.

1 answer

2


The most modern way to do this:

git merge --abort

And a little more correct way to do that:

git reset --merge

The ways described before the issue of the response would rule out local actions:

 git reset HEAD@{1}

Original answer here - SO-en

  • 1

    It would not be the case git merge --abort?

  • never used it, but searching saw that in the last verses of git this command can be used. @Sergio

Browser other questions tagged

You are not signed in. Login or sign up in order to post.