user1899082
user1899082

Reputation:

Where did my branch go?

So on Git:

First I did a git clone and checkout the Master. Then I wanted to create a branch for myself so I did a git checkout -b nameThatIForgot but I hadn't made any changes to it, no commits, etc.... nothing.

Then later today I deleted the whole folder and recloned the git repo.

So now I don't have that branch anymore? It is alright if it is gone, just wanted to make sure I am not creating an extra branch if the previous one still exists.

Upvotes: 0

Views: 77

Answers (2)

knittl
knittl

Reputation: 265547

Your branch is gone. Local branches are stored inside the .git folder of the repository. If you delete it, everything is lost (unless you have pushed to another repo).

Upvotes: 4

cdhowie
cdhowie

Reputation: 169143

If you did not push the branch to the remote repository, then it only ever existed locally. When you removed your clone, you removed the local branch along with it.

Upvotes: 4

Related Questions