简体   繁体   中英

After git add directory is empty

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM