I created a new branch new_branch, into which my changes were transferred.
no, they are not “transfered”. a new branch was simply created, a copy of the one in which the “stash” was created, i.e., a new pointer was created to the same commit that was current during the creation of the “nest”, then this new branch was assigned the current, working directory has been applied to the changes stored in the “nest egg” , and the “nest” itself has been deleted.
since you immediately followed the checkout command (with an argument . ), the changes in the working directory were deleted .
it is theoretically possible to recover a remote "nest egg" (before the "garbage collection" is carried out). example:
$ git fsck --no-reflog Checking object directories: 100% (256/256), done. dangling commit 424c2946da3bfe5cbc719f808c1a006612e5cab7
found “dangling” commit and is a remote “nest egg”. this hash can be manipulated as with a “normal stash”:
$ git show 424c294 commit 424c2946da3bfe5cbc719f808c1a006612e5cab7 Merge: 3330f58 8a98560 Author: aleksandr barakin <a.barakin@...> Date: Fri Oct 6 12:46:55 2017 +0300 WIP on master: 3330f58 20171006124552 diff --cc file index abf3108,abf3108..e1743f8 --- a/file +++ b/file @@@ -1,1 -1,1 +1,2 @@@ 2017-10-06 12:45 ++2017-10-06 12:46 $ git stash show -p 424c294 diff --git a/file b/file index abf3108..e1743f8 100644 --- a/file +++ b/file @@ -1 +1,2 @@ 2017-10-06 12:45 +2017-10-06 12:46 $ git stash apply 424c29 On branch new Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: file no changes added to commit (use "git add" and/or "git commit -a")
8-(- Nick Volynkin ♦Local Historyin the idea. There are not only for files, but also for folders (Recovered deleted files). Ave guys fromJetBrains, Ave! - Oleg