{"id":1651,"date":"2017-12-05T11:05:04","date_gmt":"2017-12-05T11:05:04","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=1651"},"modified":"2020-01-09T09:39:41","modified_gmt":"2020-01-09T09:39:41","slug":"reverting-another-users-files","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/reverting-another-users-files\/","title":{"rendered":"Reverting Another User&#8217;s Files"},"content":{"rendered":"<p><strong>scmuser created the topic: Reverting Another User&#8217;s Files<\/strong><br \/>\nCould you please help me with following&#8230;<\/p>\n<p>How do I revert files opened in another user&#8217;s client workspace?<br \/>\nHow do I revert files for a user or client that no longer exists?<\/p>\n<p><strong>rajeshkumar replied the topic: Re: Reverting Another User&#8217;s Files<\/strong><br \/>\nThere are two ways to revert files opened in a Perforce client workspace not owned by you. The first method can be done with an account with Perforce admin or super privileges while the second method can only be done by an account with Perforce super privilege.<\/p>\n<p>The simplest solution is to delete the client workspace containing the opened files. For example, if p4 opened shows:<br \/>\n\/\/depot\/main\/www\/training\/index.html#8<br \/>\n&#8211; edit default change (txt) by bruno@bruno_workspace<\/p>\n<p>the &#8220;bruno_workspace&#8221; client workspace can be deleted with:<br \/>\np4 client -d -f bruno_workspace<\/p>\n<p>You might want to revert a file without deleting the client workspace. In that case, you can impersonate the user that owns the client workspace and then run the p4 revert command. For example:<br \/>\np4 login user<br \/>\np4 -u user -c client -H host revert -k file<\/p>\n<p>where file is the file you want to revert, user is the user who has the file open, client is the client workspace where the file is opened, and host is the host name associated with that client workspace.<\/p>\n<p>Link; <a href=\"http:\/\/kb.perforce.com\/article\/38\/reverting-another-users-files\" target=\"_blank\" rel=\"noopener\">kb.perforce.com\/article\/38\/reverting-another-users-files<\/a><br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\">twitter.com\/RajeshKumarIn<\/a><\/p>\n<p><strong>alwaysharsha replied the topic: Re: Reverting Another User&#8217;s Files<\/strong><br \/>\nYou can reopen those files in to your client using &#8216;p4 reopen&#8217;, then revert the files.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>scmuser created the topic: Reverting Another User&#8217;s Files Could you please help me with following&#8230; How do I revert files opened in another user&#8217;s client workspace? How do I revert&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[370],"tags":[388],"class_list":["post-1651","post","type-post","status-publish","format-standard","hentry","category-perforce","tag-reverting"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1651","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=1651"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1651\/revisions"}],"predecessor-version":[{"id":1652,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1651\/revisions\/1652"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=1651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=1651"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=1651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}