Shit happens when you accidentally delete some files in your workspace and you have no ideas which one is deleted. One way to find them is to use 'p4 diff' command.

p4 diff -sd

This will show only the names of unopened files that are missing from the client workspace, but present in the depot. Find those files and use the following to update those files in your workspace.

p4 sync -f <file>

Alternatively you can do this in a massive way by using:

p4 diff -sd | p4 -x - sync -f

This will update all the missing files in workspace and keep your workspace consistent with the depo on the server.

P.S. Using 'p4 sync' without '-f' will not sync the files from server to your workspace, because p4 has already synchronised the file for you and it is not aware of your deleting of it, as long as there are no new versions of the file, it will not sync it for you, unless you use '-f' parameter.

[ImportNew] Perforce - Restoring Mistakenly Deleted Files in Workspace的更多相关文章

  1. How do I commit all deleted files in Git?

    Try this: $ git add -u This tells git to automatically stage tracked files -- including deleting the ...

  2. git Staging Deleted files

    Use git rm foo to stage the file for deletion. (This will also delete the file from the file system, ...

  3. 谈谈Perforce

    实习就要结束了,收获之一就是学会了使用Perforce! Perforce SCM System是一款构建于可伸缩客户/服务器结构之上的软件配置管理工具.仅仅应用 TCP/IP,开发人员就能够通过多种 ...

  4. perforce 使用教程(zz)

    http://www.perforce.com/documentation/perforce_technical_documentation http://blog.csdn.net/brucexu1 ...

  5. Getting Started Synchronizing Files

    https://msdn.microsoft.com/en-US/library/bb902813(v=sql.110).aspx Sync Framework includes a file syn ...

  6. 'workspace' in VS Code

    What is a 'workspace' in VS Code? You can save settings at the workspace level and you can open mult ...

  7. P6 EPPM Installation and Configuration Guide 16 R1 April 2016

    P6 EPPM Installation and Configuration Guide 16 R1         April 2016 Contents About Installing and ...

  8. oracle_How to Recover Data (Without a Backup!)

    How to Recover Data (Without a Backup!) It's the classic career-limiting maneuver(职业限制机动): accidenta ...

  9. Total Commander 8.52 Beta 1

    Total Commander 8.52 Beta 1http://www.ghisler.com/852_b1.php 10.08.15 Release Total Commander 8.52 b ...

随机推荐

  1. iTerm2 cheatsheet (from github)

    https://gist.github.com/helger/3070258 Tabs and Windows Function Shortcut Previous Tab ⌘+ Left Arrow ...

  2. linux在home目录下使用ls命令卡死

    linux在home目录下使用ls命令卡死,原因可能是mount的某个服务器挂掉或出啥问题了,这个时候umount掉就正常了,如果umount提示device is busy,这时可以使用强制卸载   ...

  3. 【补充版】HashMap(根据value筛选查找)

    HashMap查找之根据Value查找 一般大家都知道对于HashMap而言都是通过key来进行查找.找到了key自然对应的value也就一并找到了.但是有些情况下就需要通过value来进行判断查找. ...

  4. sql server 数据遍历插入表变量

    )) DECLARE @str VARCHAR(MAX) ,) ,@start INT ,@end INT ,) SET @str = '1,2,3,4,5,6,7,8' SET @split = ' ...

  5. 遗传算法之GAUL

    遗传算法之GAUL简介 简介        GAUL(遗传算法工具库的简称) GAUL is an open source programming library, released under th ...

  6. mysql查询表的数据大小

    在需要备份数据库里面的数据时,我们需要知道数据库占用了多少磁盘大小,可以通过一些sql语句查询到整个数据库的容量,也可以单独查看表所占容量. 1.要查询表所占的容量,就是把表的数据和索引加起来就可以了 ...

  7. JavaScript 随笔2 面向对象 原型链 继承

    第六章 面向对象的程序设计 1.创建对象的几种方式 A)工厂模式 function CreatObj(name,sex,age){ this.name=name; this.sex=sex; this ...

  8. [原创]AD9212采样方法

    随记 最近由于工程原因用到ADC的采样,选用了ADI公司的AD9212芯片,八通道10位ADC.在进行ADC的采样时,看到的想到的几种方法,在这里做个笔记记录一下. AD9212简介 详细说明可以在A ...

  9. python学习笔记(一):作图

    1.需要导入的包 import seaborn as sns import numpy as np from numpy.random import randn import matplotlib a ...

  10. AppScan 测试需要输入用户名密码的网站

    Cisco有专门的网页版的AppScan,使用前需要向有关的team申请account和权限. account和权限申请成功后,登录AppScan网站,创建自己的文件夹目录,然后在自己的目录下新建sc ...