Reputation: 25
I am confused with git.
I am here
|
=>c1=>c2=>c3=>c4=>c5=>c6=>c7
|
needed commit
How to get the exact code from c5 commit? I don't need c6 and c7 anymore.
Upvotes: 0
Views: 75
Reputation: 1683
You can do the git revert
also. Do the reverts one at a time.
git revert HEAD # Reverts c7
git revert HEAD~2 # Reverts c6
Upvotes: 0
Reputation: 37742
If I understand your question well, you want to completely remove commits c6 and c7 FOREVER?
locally:
git reset --hard HEAD~2
then to push to remote (-f to force; THIS IS DANGEROUS!)
git push -f
NOTES:
Upvotes: 3