I imported tags into the wrong workspace ID 40, instead of the latest workspace ID 38.
ID 40 did not exist before the import.
If I visit https://tagmanager.google.com/#/versions/accounts/xxx/containers/xxx/versions?containerDraftId=40 I don't see version 40 to delete, and even if I set version 38 as the latest version (it already was) I am still redirected from https://tagmanager.google.com/#/container/accounts/xxx/containers/xxx/workspaces/38/ to https://tagmanager.google.com/#/container/accounts/xxx/containers/xxx/workspaces/40/
Do I delete version 40 from this screen?
or will this delete everything?
I've exported workspace version 38.
Help appreciated.
Seems to me like you're mixing up workspaces and versions. These two are disassociated. Versions only increment when you publish. Workspaces can be created or deleted without changing the version numbers. You can treat workspaces as git branches and publishing would be just merging them with main. Whenever one workspace is published while another workspace exists, it will offer you to update the other workspace. This would be just pulling main into your branch, effectively.
Version id can only be incremented. It can't be reduced. So when you publish something by mistake and go from version 38 to version 39, and then you want to roll back to 38, you still can. But when you roll back to 38, GTM creates version 40. Even though the version number is 40, the codebase in it would be from 38.
It may seem overcomplicated, but it makes sure all you do in GTM in terms of publishing is accounted for and recorded in the version history.
So stop paying too much attention to version numbers. Pay attention to the codebase in versions or rather the changes you're deploying.
Also, no, you don't delete versions from the workspace screen. You don't delete versions at all. If you need to manage versions, you go to versions: