1

I am a newbie in Git and it is seems a bit challenging. I have made changes in a local directory of my repository. These changes are the deletion of a file and the modification of several. How can I go back to the initial state before this changes happen?(This is the state when the repository was cloned)

alex
  • 479,566
  • 201
  • 878
  • 984
Potney Switters
  • 2,902
  • 4
  • 33
  • 51

2 Answers2

2

You can simply use...

git checkout .

...which will throw away all dirty changes.

alex
  • 479,566
  • 201
  • 878
  • 984
2

You can clear all local changes by doing this.

git reset --hard

https://www.kernel.org/pub/software/scm/git/docs/git-reset.html

Note that it is case-sensitive.

TheBuzzSaw
  • 8,648
  • 5
  • 39
  • 58