Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in DevOps and Agile by (29.3k points)
edited by

I would like to undo my git pull on account of unwanted commits on the remote origin, but I don't know which revision I have to reset back to.

How can I just go back to the state before I did the git pull on the remote origin?

1 Answer

0 votes
by (50.2k points)

To undo a git-pull you could use: 

git reset --keep [email protected]{1}

This command will undo the pull command and return back to the previous state.

In the older version of git the command is something like:

git reset --hard [email protected]{1}

This command can erase all the local changes. You need to be more careful using -- hard option.


Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers


94.1k users

Browse Categories