0
git merge --abort

then it went back to latest commit head and deleted all my files.

My project was on merging stage and I did

git add 
git commit -m "message"

then it didnt allow me to commit saying "cannot do a partial commit during merge" then I aborted merge by

git merge --abort

Then it deleted all my files and went back to last commit stage. This cause me lose all my files and codes i did in between.

How to recover all my files that i had before i ran git merge --abort

5
  • Possible duplicate of Restore git files deleted after git merge --abort
    – jojo
    Commented Jul 14, 2019 at 6:33
  • didnt help. asked the question after hearing out many options.
    – TeachMe
    Commented Jul 14, 2019 at 13:11
  • Are you including that period in the command? Commented Jul 14, 2019 at 16:39
  • @evolutionxbox No. that is typo
    – TeachMe
    Commented Jul 17, 2019 at 9:12
  • Make sure to resolve all conflicts by making the changes and adding all of those files before committing. I think this is why you're getting the partial commit error. You can't recover the files if your IDE doesn't have them in it's history. This is similar to resetting (hard) before you've added or committed changes. Commented Jul 17, 2019 at 10:15

0

Browse other questions tagged or ask your own question.