0

I have a git repo I pulled down. I made some changes to the code locally. I simply want to revert those changes and not use them. Is there any way to do this???? Why is it so difficult? I don't want to have to commit anything... I just want to revert my local code back.

I am looking for a simple command to do this.

For example, SVN made it extremely easy. All I had to do was delete the file and "update my code" and it would be reverted.

Xogle
  • 363
  • 3
  • 16

2 Answers2

1

git reset --hard HEAD will reset head and get rid of any changes you've made.

Peter Foti
  • 5,526
  • 6
  • 34
  • 47
  • 2
    `HEAD` refers to the tip of your most recent commit. In your case, it points to the state of the repository when you pulled it. – DanGordon Oct 28 '15 at 19:28
0

Git is not hard but just very different from SVN. This command will revert all changes to tracked files:

git reset --hard HEAD
Arkadiusz Drabczyk
  • 11,227
  • 2
  • 25
  • 38