mal
mal

Reputation: 3224

How can I restore a deleted file in a complex git rebase?

I'm in the middle of a complicated rebase, I'm on rebase 6/10.
Somehow, it appears that a class required by both branches got deleted along the way. I'm not sure how that happened. So according to git 'they' deleted the file, to resolve this and restore the file, is it just a case of adding the two modified files and ignoring the deleted one, then doing git rebase --continue ? Will that restore the ControllerBase.java file?

git rebase screenshot

Upvotes: 1

Views: 293

Answers (1)

Romain Valeri
Romain Valeri

Reputation: 22027

Yes, you can.

git checkout --ours -- fullpath/to/ControllerBase.java
git add fullpath/to/ControllerBase.java
git rebase --continue

should be enough since it's on the "theirs" part that deletion happened.

Upvotes: 4

Related Questions