0

I am very new to git, I am using Ubuntu terminal to perform git actions. After creating a git repository I executed the below commands

mkdir project

cd project

git init

then I copied all the files to project directory and executed

git add -A 
git commit 
git push origin master

Everything looks fine but it deleted all the files from my project directory.!! But all the files are safe in the server under master tag!!

Then I tried git pull origin master it says

 * branch            master     -> FETCH_HEAD
Already up-to-date.

Whats wrong with my steps? How can I pull the files?

Gilson PJ
  • 3,443
  • 3
  • 32
  • 53

1 Answers1

1

Looks like you have deleted all your files by accident, do one thing

run:

git stash

it will revert the working directory to HEAD commit,and you will get your files back.

Siddharth
  • 859
  • 8
  • 16
  • Thank you so much. Its working.!! But I am sure I didn't deleted any files through terminal or explorer. I don't know what happen. I checked history, only git related commands are there. Anyway Thank you so much Siddarth for the quick response – Gilson PJ Oct 08 '16 at 12:28
  • checkout your terminal history to see all the commands that you have used, maybe you could find something there, happy to help :) – Siddharth Oct 08 '16 at 12:30
  • 1
    After your answer I checked, there is no deletion. But anyway it solved my issue – Gilson PJ Oct 08 '16 at 12:41