How to undo deleting a remote Git branch?

38 Views Asked by At

I've removed a remote Git branch (and the local remote-tracking branch) using the command:

git push origin --delete <branch_name>

How do I undo this action?

1

There are 1 best solutions below

0
amer On

Push last knows local version of that branch:

git push -f origin last_known_good_commit:branch_name