Reputation: 1549
I am trying to go back N
commits in the repo.
Following this answer, I did git revert HEAD~N..HEAD
Now what do I do?
I expect to be able to checkout -b <somebranchname>
and then push and do a pull request, is this ok? I don't want to mess up.
Upvotes: 1
Views: 44
Reputation: 521249
You ran the following command:
git revert HEAD~N..HEAD
As you have used it, it would revert the last N commits before and including the current HEAD commit. It does so by actually making separate revert commits for each commit in the range. These revert commits functionally undo the commits you originally made. At this point, you may work with your branch as usual, making new commits, and there should be no problems with pushing.
Note that if you just want a single revert commit, you may use the -n
option, and then commit:
git revert -n HEAD~N..HEAD
git commit -m "revert commit range"
Upvotes: 1