Unshelve changelists
You can unshelve a changelist to restore its shelved files into a workspace as open files in a pending changelist. Unshelving is the standard way to pick up shelved work for code review, cross-platform testing, or hand-off to another user.
The p4 unshelve command takes a shelved changelist number with the -s option:
p4 unshelve -s shelved-change
To unshelve a file into a specific pending changelist, use the -c option:
p4 unshelve -s shelved-change -c pending-change //depot-path/file
For a worked unshelve example for code review, see Shelve changelists.
Access shelved content for files that are exclusively locked
P4 Server does not support unshelving open files into a read-only pending changelist. If a shelved file is exclusively locked, the lock prevents p4 unshelve from succeeding for any other user.
To access the content of the shelved file, use the p4 print command with the -o option and the @=shelved-change version selector. The command writes copies of the shelved file content to the local filesystem without opening any file for edit, so the exclusive lock does not apply.
The following command downloads each file from shelved changelist 12345 to the corresponding location in the current working directory:
p4 print -q -o ... @=12345
If the current working directory is a workspace root, the command writes the files into the same workspace folders that p4 unshelve would use. You can also write the files to any other local path.
If the command returns the following error:
Failed to map '//depot/path/filename' to target path!
run the command using the full depot wildcard:
p4 print -q -o ... //...@=12345