简体   繁体   English

git add目录为空后

[英]After git add directory is empty

I am very new to git, I am using Ubuntu terminal to perform git actions. 我对git非常陌生,我正在使用Ubuntu终端执行git操作。 After creating a git repository I executed the below commands 创建git存储库后,我执行了以下命令

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 然后我尝试了git pull origin master它说

 * 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 git stash

it will revert the working directory to HEAD commit,and you will get your files back. 它将工作目录恢复为HEAD commit,您将把文件取回来。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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