So our designer made some changes to some images, and committed the changes. So now our git log looks something like this:
Commit 1: Changed images
Commit 2: Oops, forgot to commit a few images
…then the business wanted them to look different, so the designer changed them, and committed them again:
Commit 1: Changed images
Commit 2: Oops, forgot to commit a few images
Commit 3: Changed images again
Commit 4: Minor tweaks to new images just committed
…now the business decided that they liked the images better the first time. So now we need to roll back to the way they were near the beginning. I have tried a few different approaches and I think the approach I need to use is git revert so that I can create a new commit that reverts the images back to the way they were before. However, I seem to be having conflicts when I try to do this. How should I do this so that I can force the new images to be overwritten with the changes made in Commit 1 and Commit 2?
What you want to do is check the file out from an old commit.
It’ll look like:
that commit refspec might be HEAD{4} or might be a SHA or maybe a tag…. Something that refers to that commit. Then it’ll be sitting in your working directory as a change to add and commit.