0

I have accidentally deleted my .git directory

I've reinstantiated the repository with git init and readded my remote with git remote add origin [email protected]

How do I specify which branch I am currently on without losing my work?

1

1 Answer 1

0

I ended up doing the following sequence:

git add .gitignore

git commit -m "temp

git stash

git checkout initial_branch_i_was_on

git fetch

git rebase origin/develop

git stash pop

And then manually resolving the handful or rebase issues. Everything said and done it was painless enough. Whether or not there is a better way I don't know.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.