在 Perforce 中,如何恢复对文件所做的更改?
$ p4 status
UI\FormMain.cs - reconcile to edit //UI/FormMain.cs#73
$ p4 revert UI/FormMain.cs
UI/FormMain.cs - file(s) not opened on this client.
在 Git 中,我使用命令来执行此操作git checkout
。
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: Form.cs
#
no changes added to commit (use "git add" and/or "git commit -a")
$ git checkout Form.cs
$ git status
# On branch master
nothing to commit, working directory clean