From 352e937caa22dd6176a3abc44bfd5c7f8323c280 Mon Sep 17 00:00:00 2001 From: Dimitrios Theodorakis Date: Mon, 2 Dec 2024 18:11:53 +0000 Subject: [PATCH] Adds instructions for restoring a feature branch from a backup when rebasing goes wrong. --- episodes/08-rebase.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/episodes/08-rebase.md b/episodes/08-rebase.md index 1fdad54..b6e1f4d 100644 --- a/episodes/08-rebase.md +++ b/episodes/08-rebase.md @@ -162,6 +162,26 @@ goes wrong during the rebase: $ git branch add_plot_script.backup ``` +If at anytime you want to restore the branch +from your backup switch to the backup: + +```bash +$ git switch add_plot_script.backup +``` + +Delete the branch where rebasing was attempted: + +```bash +$ git branch -D add_plot_script +``` + +Re-create the original branch while still +on the backup branch: + +```bash +$ git switch -c add_plot_script +``` + ::: We will rebase interactively using the `-i` flag.