Marvin
Marvin

Reputation: 1

Local Branch Recovery

I had a branch with changes (not stashed or committed) and from that I have created a new sub-branch. It was said 'All uncommited changes will be preserved on the new branch.'. I thought they are also preserve in the initial branch, so I have done some tests in the sub-branch and deleted it (again without stash or commit). I checked out to the initial branch and my changes are gone.

Is there any possibility to recover my changes that have been transferred to the now deleted sub-branch?

Upvotes: 0

Views: 199

Answers (1)

LeGEC
LeGEC

Reputation: 51850

As far as git goes : the only files that are stored in git are commits (and the stash, and to some extent the files that are git added and not committed yet)

The sentence "All uncommited changes will be preserved on the new branch" indicates that git doesn't delete the files from your disk when you switch branches, but it doesn't keep them in its internal storage either.


If you have deleted untracked files from your disk, check if your IDE has its own "file history" mechanism to restore past files, or turn to a file recovery utility for your system.

Upvotes: 2

Related Questions