Making git pull I got errors :
error: Your local changes to the following files would be overwritten by merge:
public/js/file.js
public/file.json
Please commit your changes or stash them before you merge.
I saved list of all modified files with
git status
and command run
git stash
I merged all files now I need to restore all my changes. List of all files is rather big, including deleting/new files, like:
On branch main
Your branch is up to date with 'origin/main'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: app/Http/Controllers/ItemController.php
new file: app/Http/Controllers/BoxController.php
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: .gitignore
modified: app/Http/Controllers/ItemController.php
Untracked files:
(use "git add <file>..." to include in what will be committed)
app/Http/Controllers/ItemController.php
app/Http/Requests/ItemRequest.php
When I need to restore some modified files I can apply changes manually, but
How to restore deleted/new files?
Is the listing of all modified files is rather big, how can I make it better, not manually checking them one by one?
To restore your changes do git stash apply
. However, it looks like your merge is incomplete. You need to git commit
the merge before trying to apply your stash.