-1

I want to remove all my local changes and revert to the repo version with Git. I've created new files which I haven't added or committed.

I've tried this command but it doesn't delete the new files I've created.

git reset --hard
Jan Vorcak
  • 19,261
  • 14
  • 54
  • 90
Evanss
  • 23,390
  • 94
  • 282
  • 505

2 Answers2

0

Just delete the new files manually or execute git clean -f and after that execute git stash

Saša Šijak
  • 8,717
  • 5
  • 47
  • 82
0

git clean -fdx will delete (recursively) all unversioned files. You can use this in tandem with git checkout -- or git reset --hard to get a completely clean version of your repo.

kfb
  • 6,252
  • 6
  • 40
  • 51