Reputation: 2016
We are working with a the NopCommerce framework. Development means that we have to include the core code as part of the build process. We have the project in a git repository. At some point, someone merged in the NopCommerce github DEV branch, updating all of the core files. We never change core as a principal, but we try to stay with the current release. That somehow got us on the dev branch . We recently caught this when we noticed the version change, but there have already been many more commits to the repository with our private libraries.
I'd like to know if there is a way to revert that commit that updated the core code, or if I'm just going to have to manually replace all of the files with the ones I want and do a giant manual diff on the whole thing.
Upvotes: 1
Views: 67
Reputation: 697
If you know the specific commit that changed the files you can use either the revert or the checkout command. If the changes you want to revert were the only changes in the commit you want to roll back, use git revert <commit>...
where <commit>
is the commit you want to revert. Otherwise, use git checkout <commit> -- <filename>
substituting the path of the files which you want to revert, and in this case <commit>
should be the commit prior to the commit which you want to roll back.
Upvotes: 2