-1

I had a file the way I wanted it and committed it, then changes were made to it and not committed.

There is no remote associated with the repo.

How do I revert the most recent changes that were not committed?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
CJ Jean
  • 971
  • 1
  • 8
  • 10
  • Possible duplicate of [Reset or revert a specific file to a specific revision using Git?](http://stackoverflow.com/questions/215718/reset-or-revert-a-specific-file-to-a-specific-revision-using-git) – the Tin Man Apr 11 '17 at 17:52
  • 1
    Possible duplicate of [git undo all uncommitted changes](http://stackoverflow.com/questions/14075581/git-undo-all-uncommitted-changes) – 1615903 Apr 12 '17 at 05:15

1 Answers1

0
git reset HEAD --hard

or

git checkout -- <file path + name>

git-reset
Reset current HEAD to the specified state

enter image description here

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
  • 1
    Thanks! cool visualization. I will look into the diff between `reset head --hard` and `checkout -- ` . Do I need to type the actual `<` and `>` ? – CJ Jean Apr 11 '17 at 18:12