Skip to content

Commit 78cc223

Browse files
MetOffice#19 Adds instructions for restoring a feature branch from a backup when rebasing goes wrong.
1 parent 64cb250 commit 78cc223

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

episodes/08-rebase.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,26 @@ goes wrong during the rebase:
162162
$ git branch add_plot_script.backup
163163
```
164164

165+
If at anytime you want to restore the branch
166+
from your backup switch to the backup:
167+
168+
```bash
169+
$ git switch add_plot_script.backup
170+
```
171+
172+
Delete the branch where rebasing was attempted:
173+
174+
```bash
175+
$ git branch -D add_plot_script
176+
```
177+
178+
Re-create the original branch while still
179+
on the backup branch:
180+
181+
```bash
182+
$ git switch -c add_plot_script
183+
```
184+
165185
:::
166186

167187
We will rebase interactively using the `-i` flag.

0 commit comments

Comments
 (0)