1
I created a repository on github, gave my git init folder and after that I made the mistake of giving these two commands below, after that my files that were in my folder disappeared... how to get back the files ? i had not yet given any commit.
git add -A
git reset --hard
deivison@Desso MINGW64 /c/xampp/htdocs/adega (master)
$ git status
On branch master
Initial commit
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: .editorconfig
new file: .gitignore
new file: .htaccess
new file: application/.htaccess
new file: application/cache/index.html
new file: application/config/autoload.php
new file: application/config/config.php
new file: application/config/constants.php
new file: application/config/database.php
new file: application/config/doctypes.php
new file: application/config/foreign_chars.php
new file: application/config/hooks.php
new file: application/config/index.html
new file: application/config/memcached.php
new file: application/config/migration.php
new file: application/config/mimes.php
new file: application/config/profiler.php
new file: application/config/routes.php
new file: application/config/smileys.php
new file: application/config/user_agents.php
new file: application/controllers/Cliente.php
new file: application/controllers/Entrada.php
new file: application/controllers/Movimentacao.php
new file: application/controllers/Produto.php
new file: application/controllers/Saida.php
new file: application/controllers/Template.php
new file: application/controllers/Venda.php
new file: application/controllers/index.html
new file: application/core/index.html
new file: application/helpers/index.html
new file: application/hooks/index.html
new file: application/index.html
new file: application/language/english/index.html
new file: application/language/index.html
new file: application/libraries/index.html
new file: application/logs/index.html
new file: application/models/M_Cliente.php
new file: application/models/M_Produto.php
new file: application/models/index.html
new file: application/third_party/index.html
new file: application/views/entrada.php
deivison@Desso MINGW64 /c/xampp/htdocs/adega (master)
$ git push -u origin master
error: src refspec master does not match any.
error: failed to push some refs to 'origin'
deivison@Desso MINGW64 /c/xampp/htdocs/adega (master)
$ git reset --hard
I recommend you read this basic guide(is in English), will familiarize you with the commands and basic operation of
git
.– Tuxpilgrim
See if you can restore with
git checkout .
. I do it every time I change something.– Wallace Maxters
deivison@Desso MINGW64 /c/xampp/htdocs/adega (stock) $ git checkout . error: pathspec '.' Did not match any file(s) known to git. deivison@Desso MINGW64 /c/xampp/htdocs/cellar (stock) $ git checkout master error: pathspec 'master' Did not match any file(s) known to git. This is the error, and I can’t get back to the master branch
– user120419