2

I want to check the diff between current master branch and an old git tag (lets say, tag1).

After checking the differences, I want to discard the changes and merge tag1 into my master branch because tag1 is currently running in production and I want my master to be updated with it.

How can I do these tasks?

loadbox
  • 646
  • 14
  • 34

1 Answers1

2

You could use git revert, assuming tag1 is an older commit on the master branch:

git revert tag1..master

Or you can use git reset (with the --soft option):

git switch master
git branch tmp master
git reset --hard tag1
git reset --soft tmp
git add .
git commit -m "commit tag1 content to master"
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250