Hello! By mistake I did `gt bc -i someBranch` whil...
# how-do-i
l
Hello! By mistake I did
gt bc -i someBranch
while being on
main
🤦 Now all my stacks are based on that
someBranch
How do I undo that without going to all stack and
gt upstack onto main
? I've tried
gt branch fold
but that is not allowed on the trunk branch (makes sense) despite having no commit yet.
p
going up one branch from
someBranch
and invoking
gt upstack onto main
is the solution here I believe...any reason you don't want to do that?
l
I had a loooooot of branches on top on main. So I'd have to do what you say a looooot of time.
p
I've tried
gt branch fold
but that is not allowed on the trunk branch (makes sense) despite having no commit yet.
do you mean there was no commit on
someBranch
yet? in that case could you just
gt bdl someBranch
after stashing any unstaged changes, then redo the
gt bc
command?
I had a loooooot of branches on top on main. So I'd have to do what you say a looooot of time.
Hm I'm not sure I understand - given you have
main
->
someBranch
->
A
->
B
->
C
->
D
-> ..., checking out
A
and doing
gt upstack onto main
would result in
main
->
A
->
B
->
C
->
D
-> ... and
main
->
someBranch
and wouldn't affect any other branches you have on top of main
l
I had :
Copy code
main
|-A
|-B
|-C
|-...
|-Z
Then while on
main
I did
gt bc -i OOPS
and get
Copy code
main
|- OOPS
     |-A
     |-B
     |-C
     |-...
     |-Z
There is no commit on OOPS yet. I want to get rid of it and go back to the previous state.