Jump to content

Recommended Posts

Posted

Hi guys..I am learning to use GIT manage my repo..but i have a question: How to revert commits?

I means how to revert commits which is't the last commits? for example,i commit for 3 commits,it is A Band C,now i only want to revert A,but B and C remain contains in my work branch,how to do it?:o

Posted

if it is not published to "the world" the cleanest and easiest way is git rebase -i (see git rebase --help)

if it published, you shouldn't rebase, because you will corrupt your history, in such a case git revert --help should help you

Posted

so.. as far as i know....

git revert <here.. the first 8th numbers from commit.... for ex: mangos 10426 has : a1b97ce3036b58706faeb66d43caffd3c0509e13... you will type ... "git revert a1b97ce3" >

hope it works

let me know if this is the right way

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use