问题
I recently ran 'bundle update,' and it updated the Twitter-bootstrap-rails gem to the latest version. Ever since then, the header size has changed, and I would like to roll back to the previous gem versions for all my gems.
I tried rolling back to my previous gemfile and bundle updating, but the problem was I didn't specify versions in my gemfile so it doesn't know to degrade a version. I also tried checking the specific previous version and specifying that, but I think all the dependencies changed as well.
So I need to find a way to just go back to using all the old versions, which seems to be stored in the Gemfile.lock file. How would I do this?
回答1:
you can easily go back to a version of any file that you track in git with
git checkout <some-ref> -- path/to/your/file
where some-ref is
HEAD^
HEAD~5
v1.2
some-branch
etc
回答2:
One way to do this, if you're using git is as follows
git checkout -- Gemfile.lock
来源:https://stackoverflow.com/questions/14105201/how-do-you-rollback-to-a-previous-gemfile-lock