1

I have admin.html file. I modified it. I am working on master.
But before committing it, I did git pull.
There is admin.html file in BitBucket, and my (changed) admin.html file is overwritten by the admin.html file in BitBucket.

How can Irecover my changed admin.html file?

5
  • Did yuu add that file in the index (git add) before the git pull?
    – VonC
    Commented Oct 12, 2014 at 12:36
  • i am working on iteration branch.i tried to push by using git push origin iteration.it says git pull has to be done.i switched to master and made git add, git commit, and git pull.
    – raviraja
    Commented Oct 12, 2014 at 12:43
  • But when you switched to master, was that admin.html file still there? (and still modified?)
    – VonC
    Commented Oct 12, 2014 at 12:44
  • yes.when i did git pull my changed file was overwritten by the file in bitbucket.
    – raviraja
    Commented Oct 12, 2014 at 12:45
  • But it was committed first, before the git pull, right?
    – VonC
    Commented Oct 12, 2014 at 12:46

1 Answer 1

0

I am working on iteration branch. I tried to push by using git push origin iteration
It says git pull has to be done.
I switched to master and made git add, git commit, and git pull

Then you can show or restore an older version of that file (try HEAD~, or git log -- admin.html to find the right SHA1, looking for its history)

Not the answer you're looking for? Browse other questions tagged or ask your own question.