How to undelete a branch?

shaulbehr May 26, 2015

We merged a pull request on a branch and then deleted the branch.

Now apparently we still want to keep the branch.

How do we undelete it?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
ThiagoBomfim
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 26, 2015
1 vote
Mibex_Software
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2015

Hi,

Stash prevents deleting a branch that is part of an open pull request. I guess you deleted it with Git itself then. Your pull request got declined in that case. Just push the branch again to your remote and open a new pull request.

Kind regards,

Michael

shaulbehr May 26, 2015

Clarification: the branch was deleted *after* the pull request was approved and merged. Now a developer wants to continue working in this branch.

Mibex_Software
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2015

The user should be able to push the local branch again, or am I wrong?

shaulbehr May 26, 2015

Oh yeah, that is true. And that will work for now. But hypothetically, if we deleted the repository on remote and on local, would there be anyway to get it back?

Mibex_Software
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2015

From your backup. If you don't backup your Git repositories yet, you might want to have a look at the Stash Backup Client: https://marketplace.atlassian.com/plugins/com.atlassian.stash.backup.client

TAGS
AUG Leaders

Atlassian Community Events