0

This could be a very simple question. I commited my work, then I launched a find and replace script but I want to undo it, so to let my work go down to the actual commit. What is the right command to do that : I know about git reset soft/hard or git amend but it is not appropriate

user1611830
  • 4,749
  • 10
  • 52
  • 89

1 Answers1

2

You have a couple of options:

As the comments state git reset --hard will bring everything back.

But if you want to keep some of the files modified then doing:

git checkout -- <filename>

Will undo individual files.

Schleis
  • 41,516
  • 7
  • 68
  • 87
  • Ouah, I put git reset --hard, I indeed went to my last commit but all the modifications I commited disappear. I don't know what screwed up, is oit possible to find the history of files including what they were after git reset --hard – user1611830 Jan 31 '13 at 14:50
  • Git reset --hard undoes all your changes. If you did not commit the changes, there is no way to see them. http://www.kernel.org/pub/software/scm/git/docs/git-reset.html – Schleis Jan 31 '13 at 15:23