GreatDane
GreatDane

Reputation: 693

Someone removed a commit from remote repo after I pulled it, how do I keep it locally on the next git pull?

Someone removed a commit from the remote repository after I had done a git pull.

Locally I now have these commits:

$ git log --oneline
a7f2d6a commit x
29087ce commit y
8a851c8 commit z

But a7f2d6a commit x was removed from the remote repository. What do I have to do so that the next git pull doesn't remove it from my local commits? I would like to further push it back to the remote repo after I do some more work.

Upvotes: 2

Views: 69

Answers (1)

Ehsan K. harchegani
Ehsan K. harchegani

Reputation: 3128

Well, you can create a branch base on the branch that contains the commit and after that merge it to the original branch.

Upvotes: 3

Related Questions