How to restore a deleted branch in CodeCommit ?

4

Hi, Like Github, is there a way to restore a deleted branch in CodeCommit ?

thiru
asked a year ago1236 views
1 Answer
1
Accepted Answer

When you delete a branch from the console, there is a message that says:

Deleting a branch from AWS CodeCommit cannot be undone from the console. However, users might continue to have a copy of this branch in their local repositories until the next time they pull changes.

Do you have a local copy ? if so you can find the SHA for the last commit of your deleted branch using: git reflog and restore the branch using git checkout -b <branch> <sha>.

profile pictureAWS
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions