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. python生成透时图片and 写文字

    import Image from get_png import getpng def transparent(infile): #open png,covert it into 'RGBA mode ...

  2. nginx + lua +redis环境搭建

    环境搭建,其实主要是lua的环境,这个环境够麻烦的,在网上找了很多前辈的文章,终于完成了 ,安装redis wget http://download.redis.io/releases/redis-3 ...

  3. javac 命令出现 找不到文件 问题及解决办法

    如果环境配置好了,使用java -version回车可以正常查看到版本信息. 使用javac Demo.java 如果提示文件找不到 可能原因1: 源文件与当前命令行不在同目录下,这时候就要切换到同一 ...

  4. Oracle重启 error: ora-01034:oracle not available ora-27101:shared memory realm does not exist

    error: ora-01034:oracle not available ora-27101:shared memory realm does not exist 苦咖啡 他的博客中一篇文章完美的解 ...

  5. 关于Intent的七大重要属性

    在Android 中,Intent用来封装两个Activity之间的调用意图,实现两个Activity之间的跳转,并传递信息. Intent的七大重要属性:ComponentName Action   ...

  6. 收缩SQL Server 数据库的几种方法

    方法一: Use 数据库名 Select NAME,size From sys.database_files ALTER DATABASE 数据库名 SET RECOVERY SIMPLE WITH ...

  7. Linux 安装git

    0.安装git前: 先去git 官网上看一眼,Linux怎么安装git , 原来非常简单,只需要输入命令即可,但是不同的linux 版本对应的命令不一样: 命令行查看Linux版本: $ cat /e ...

  8. 调整Win7中TCP/IP半开连接数限制

    调整Win7中TCP/IP半开连接数限制      相信大家都有过这样的经历,普通的ADSL宽带下,打开下载工具下载资源时,再想浏览网页就会变得非常困难了,Windows7中也未能幸免.   究其原因 ...

  9. php namespace用法

    其实纠结了很久要不要使用这个东西,但是看看了最新的框架laravel,cakephp等等的新版本都使用上了,所以还是随大流顺便学习下. namespace和c++里面的概念差不多,只是用法有点差别. ...

  10. C++中关于文件的读写

    在C++的学习过程中,我们时常要用到对文件的操作,下面我们讲一下文件的读写. 首先,读.也就是把已有的文件读到控制台上,那么如何操作呢?首先要将文件操作的输入输出流包含进去. <fstream& ...