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. mac升级后提示pod: command not found

    问题:升级mac到10.12使用pod,提示pod: command not found   解决方法:sudo gem install -n /usr/local/bin cocoapods   如 ...

  2. LeetCode之Largest Rectangle in Histogram浅析

    首先上题目 Given n non-negative integers representing the histogram's bar height where the width of each ...

  3. KVO

    •基本概念 Key Value Observing, 键值观察者.它提供一种机制,当指定的对象的属性被修改后,则对象就会接收到通知. 与NSNotification不同,键值观察中并没有中心对象来为所 ...

  4. ubuntu 15 安装cuda,开启GPU加速

    1 首先要开启GPU加速就要安装cuda.安装cuda,首先要安装英伟达的驱动.ubuntu有自带的开源驱动,首先要禁用nouveau.这儿要注意,虚拟机不能安装ubuntu驱动.VMWare下显卡只 ...

  5. Python模块:hashlib

    hashlib:提供了常见的摘要算法,如MD5,SHA1等. import hashlib m = hashlib.md5() m.update('how to use md5 in python h ...

  6. mysql学习(4)-mysqldump备份和恢复数据

    背景 最近在公司做数据迁移方面的工作,使用mysql数据库在测试环境模拟数据迁移,在迁移测试的过程中需要做数据备份和恢复 mysql数据备份和恢复比较简单,可以选择mysqldump工具,这里简单提一 ...

  7. IIS发布WCF服务项目之本地

    最近由于项目需求,要做一个上传文件附件的功能,由于是多用户访问,所以这就用到了WCF服务,程序编写完成就需要发布了, 下面记录下发布到IIS的过程: 1,安装IIS 第一步:检查Windows7中II ...

  8. Android框架之AndroidAnnotations基础

    一:开源网址 https://github.com/excilys/androidannotations/wiki 二:AndroidAnnotation特点 (1)依赖注入 可以注入 views, ...

  9. 阻塞非阻塞,同步异步四种I/O方式

    举一个去书店买书的例子吧: (同步)阻塞: 你去书店买书,到柜台告诉店员,需要买一本APUE,然后一直在柜台等.(阻塞) 店员拿到书以后交给你. (同步)非阻塞: 你去书店买书,到柜台告诉店员A,需要 ...

  10. iazq更新网址

    [版本:1.1] [介绍:哈哈(ಡωಡ)hiahiahia 新版软件试试去和哥哥刚放学噢噢噢天然呆翡翠城] [链接:http://info.3g.qq.com/g/s?aid=index&g_ ...