-1

How can take file back after delete before commit Because i have a mistake that is delete whole current file

vân tang
  • 69
  • 5

1 Answers1

1

after I code but I commit in branch b, but I want to push in branch a

If you did commit, check git reflog: you will find your past commits there.

If you added the file to the index, but deleted it before a commit, you might be able to find it back using git fsck --lost-found.

But if it was deleted before ever being recorded by Git... check out editor/IDE. Some have a local history which could have recorded a version of that file.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • that's up to your editor to support. i find in history file. but it's just very less. almost just a little bit tiny. Hope that helpful!! – vân tang Sep 10 '18 at 10:18