When creating a shelveset, the shelveset is created on the server so your changes are at least stored on the server. You can choose whether you want to preserve your changes locally. If you do choose not to preserve your changes locally, the changes on the files that are included in the shelveset are undone.
Shelvesets are independent from check-ins, meaning that you always check in the changes that are contained in a workspace. It does not matter whether they originate from local changes or un-shelving one (or more) shelvesets. A check-in does not affect any shelvesets, they will stay on the server.
For details on shelvesets see this link.