0

I was trying to push my changes to my git repository so i run a common command to add my files to stage.

git add --all

But from those files, i pretended to exclude a particular file and i ran by mistake:

git checkout <file>

instead of

git reset <file>

As result, my file changes were revert to it's last state. I lost all my recent changes....

How can i revert this mess?

Lothre1
  • 3,523
  • 7
  • 43
  • 64
  • 1
    possible duplicate of [Can git undo a checkout of unstaged files](http://stackoverflow.com/questions/2689265/can-git-undo-a-checkout-of-unstaged-files) – Brandon Apr 14 '14 at 17:55

1 Answers1

5

Nope, you can only revert changes if they were already in git version control. Unstaged changes aren't tracked by Git. It sucks, and is pretty annoying, and we've all done it.

Brandon
  • 16,382
  • 12
  • 55
  • 88