Such a situation: Filled in the repository files on github. Then in the repository deleted one of the files. Now I want to upload the file with the same name (which was deleted) to the repository again.

I enter into the git console

Vit@Home MINGW64 ~ $ cd c:/xampp/htdocs/myproject Vit@Home MINGW64 /c/xampp/htdocs/myproject (master) $ git add 1.php fatal: pathspec '1.php' did not match any files Vit@Home MINGW64 /c/xampp/htdocs/myproject (master) $ git status On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working tree clean 

Confused. What to do to upload this file to github?

  • So is it local, in the current working copy, do you have? - D-side
  • Well, I have it in the folder of course on a laptop on xammp-e. What do you need to upload it to github in the folder to other files? - Beginner
  • If you accidentally deleted a file and did not push, then you can cancel the local changes "git reset --hard" - Stanislav Grot
  • I wrote this command and now I have deleted this file from myproject folder - Beginner
  • how to restore it now? - Beginner

0