есть ли способ восстановить все локально удаленные файлы в сеансе git bash? Я сделал резервную папку, но git удалил ее вместе с исходной папкой.Отменить все локально внесенные изменения в сеансе git bash
Мне нужно восстановить все файлы, перечисленные после команды git rm -rf *
. Не удается выключить компьютер, пока он не вернется.
Извините за длинный текст, но в следующем я покажу все команды, которые я пытался использовать в этом сеансе.
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git branch -D master
git rm -rf *Deleted branch master (was d30697f).
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git checkout --orphan master
Switched to a new branch 'master'
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git rm -rf *
rm 'README.md'
rm 'bootstrap/css/bootstrap-theme.css'
rm 'bootstrap/css/bootstrap-theme.css.map'
rm 'bootstrap/css/bootstrap-theme.min.css'
rm 'bootstrap/css/bootstrap.css'
rm 'bootstrap/css/bootstrap.css.map'
rm 'bootstrap/css/bootstrap.min.css'
rm 'bootstrap/fonts/glyphicons-halflings-regular.eot'
rm 'bootstrap/fonts/glyphicons-halflings-regular.svg'
rm 'bootstrap/fonts/glyphicons-halflings-regular.ttf'
rm 'bootstrap/fonts/glyphicons-halflings-regular.woff'
rm 'bootstrap/fonts/glyphicons-halflings-regular.woff2'
rm 'bootstrap/js/bootstrap.js'
rm 'bootstrap/js/bootstrap.min.js'
rm 'bootstrap/js/npm.js'
rm 'core/.DS_Store'
rm 'core/._.DS_Store'
rm 'core/ajax/ajax_handler.php'
rm 'core/classes/.DS_Store'
rm 'core/classes/._.DS_Store'
rm 'core/classes/Config.php'
rm 'core/classes/Cookie.php'
rm 'core/classes/Data.php'
rm 'core/classes/Database.php'
rm 'core/classes/Hash.php'
rm 'core/classes/Input.php'
rm 'core/classes/Redirect.php'
rm 'core/classes/Session.php'
rm 'core/classes/Token.php'
rm 'core/classes/Transformer.php'
rm 'core/classes/User.php'
rm 'core/classes/Validate.php'
rm 'core/functions/.DS_Store'
rm 'core/functions/._.DS_Store'
rm 'core/functions/login.php'
rm 'core/functions/register.php'
rm 'core/functions/sanitize.php'
rm 'core/init.php'
rm 'favicon.ico'
rm 'fontello/LICENSE.txt'
rm 'fontello/README.txt'
rm 'fontello/config.json'
rm 'fontello/css/animation.css'
rm 'fontello/css/fontello-codes.css'
rm 'fontello/css/fontello-embedded.css'
rm 'fontello/css/fontello-ie7-codes.css'
rm 'fontello/css/fontello-ie7.css'
rm 'fontello/css/fontello.css'
rm 'fontello/demo.html'
rm 'fontello/font/fontello.eot'
rm 'fontello/font/fontello.svg'
rm 'fontello/font/fontello.ttf'
rm 'fontello/font/fontello.woff'
rm 'images/006-mega-x.gif'
rm 'images/MegaGlurakX.jpg'
rm 'images/Pokeball.png'
rm 'index.php'
rm 'info.txt'
rm 'javaScripts/main.js'
rm 'logout.php'
rm 'pokenizer.sql'
rm 'slices/base/body_end.inc.php'
rm 'slices/base/body_start.inc.php'
rm 'slices/base/head.inc.php'
rm 'slices/base/html_end.inc.php'
rm 'slices/base/html_start.inc.php'
rm 'slices/base/page_end.inc.php'
rm 'slices/base/page_start.inc.php'
rm 'slices/modals/front/login_modal.inc.php'
rm 'slices/modals/front/signup_modal.inc.php'
rm 'slices/sites/start.php'
rm 'slices/sites/user.php'
rm 'slices/tests/profile.php'
rm 'slices/tests/start.php'
rm 'slices/widgets/front/heading.inc.php'
rm 'slices/widgets/front/navbar.inc.php'
rm 'slices/widgets/front/panels.inc.php'
rm 'slices/widgets/front/welcome.inc.php'
rm 'slices/widgets/loggedIn/header_options.inc.php'
rm 'slices/widgets/loggedIn/left_sidebar.inc.php'
rm 'slices/widgets/loggedOut/left_sidebar.inc.php'
rm 'styleSheets/activities.css'
rm 'styleSheets/contentArea/main.css'
rm 'styleSheets/front/main.css'
rm 'styleSheets/predefinitions.css'
rm 'styleSheets/profile.css'
rm 'users/0f2586f30af8a59f3fe278efc41f16f2/profile.jpg'
rm 'users/0f2586f30af8a59f3fe278efc41f16f2/profileFull.jpg'
rm 'users/36d38ab6c36f095dff785cf531e67ce4/profile.jpg'
rm 'users/36d38ab6c36f095dff785cf531e67ce4/profileFull.jpg'
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ ^C
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git reset (--hard) HEAD~1
bash: syntax error near unexpected token `('
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git reset --hard HEAD~1
fatal: ambiguous argument 'HEAD~1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git reset
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git checkout --$(git ls-files -d)
fatal: You are on a branch yet to be born
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git reset --hard
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git reset --hard d30697f
HEAD is now at d30697f updated
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git checkout HEAD C:\xampp\htdocs\Git\Pokenizer
fatal: C:xampphtdocsGitPokenizer: 'C:xampphtdocsGitPokenizer' is outside repository
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git checkout HEAD
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git checkout HEAD^
Note: checking out 'HEAD^'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at bea5a92... updated
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git checkout -b newbranch
Switched to a new branch 'newbranch'
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git reset -- Pokenizer/
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git checkout -- Pokenizer/
error: pathspec 'Pokenizer/' did not match any file(s) known to git.
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git ls-files –deleted
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git reset HEAD
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git checkout -- lib bin
error: pathspec 'lib' did not match any file(s) known to git.
error: pathspec 'bin' did not match any file(s) known to git.
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git ls-files -d | xargs git checkout --
[email protected] MINGW64 /c/xampp/htdocs/Git/Pokenizer (master|REBASE 1/3)
$ git ls-files -d | xargs git checkout -
Note: checking out 'bea5a92f5d9dca86ce34149c0ae9ba9eb42fd25a'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at bea5a92... updated
Я попытался команды и получил этот результат: 'Стефан @ DESKTOP-97STV3T MINGW64/с/XAMPP/HTDOCS/Git/Pokenizer (мастер | Rebase 1/3) $ мерзавца перебазирование --abort Стефан @ РАБОЧИЙ-97STV3T MINGW64/с/XAMPP/HTDOCS/Гит/Pokenizer (мастер) $ мерзавца сброса --hard ГОЛОВКИ ГОЛОВКИ теперь в обновленном d30697f Стефана @ DESKTOP-97STV3T MINGW64/c/xampp/htdocs/Git/Pokenizer (ведущий) $ git log --oneline --graph --decorate --all * d30697f (HEAD -> master, origin/master) обновлено * bea5a92 (newbranch) вверх от * b26bc2d обновленный * 45cd901 обновленный * ab1d5f4 добавлены файлы проекта * 373e232 Update README.md * 8cecd13 лол * a47ca75 Initial commit' –
перед удалением всех файлов, которые я совершенные, но я не вижу фиксации в список журналов. –