fs_tigre fs_tigre - 3 months ago 10
Git Question

How to temporarly go back to previous versions of your code but preserve the latest changes in Git

I have a

Git
repository with 2 tags, named
version-1
and
version-2
. I'm currently working on what would be
version-3
of my app, the code has changed a LOT since
version-2
and I still have a lot of work to do to release
version-3
but there are some changes/fixes that I would like to do to
version-2
and I was wondering if it would be possible to go back to tag
version-2
make the changes (bug fixes) and then come back to where I left.

Is it possible to go back to tag
version-2
make some changes (bug fixes) create a new tag
version-2.1
release changes and then come back to where I left? If yes, what would be the process?

Thanks

Answer

Easiest would be to create a branch from your tag:

git checkout version-2 -b branchname

To resume working on the new release, check out the master branch again:

git checkout master
Comments