从android中的应用程序恢复已删除的Xml文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23198486/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 06:53:02  来源:igfitidea点击:

recovery the deleted Xml file from app in android

androidrecoveryxml

提问by prakash

Is it possible to recover a deleted XML file from app in Android IDE?

是否可以从 Android IDE 中的应用程序恢复已删除的 XML 文件?

Unfortunately I deleted important files from my app.

不幸的是,我从我的应用程序中删除了重要文件。

回答by Tom

For Eclipse:

对于日食:

To restore a deleted Workbench resource with a state from the local history:

  1. In one of the navigation views, select the folder or project into which you want to restore a local history state
  2. From the resource's pop-up menu, select Restore from Local History.... The Restore From Local History dialog opens showing all files that were previously contained in the selected folder or project and all of their sub-folders.
  3. Check the files that you want to restore
  4. If you don't want to restore just the last state of a file you can select any other state of the file from the Local History list on the right hand side of the dialog. The bottom pane of the dialog shows the contents of the state.
  5. If you are done with all files click Restore.

要使用本地历史记录中的状态恢复已删除的 Workbench 资源:

  1. 在其中一个导航视图中,选择要将本地历史记录状态恢复到的文件夹或项目
  2. 从资源的弹出菜单中,选择从本地历史恢复...。从本地历史恢复对话框打开,显示以前包含在选定文件夹或项目及其所有子文件夹中的所有文件。
  3. 检查要还原的文件
  4. 如果您不想只恢复文件的最后状态,您可以从对话框右侧的本地历史列表中选择文件的任何其他状态。对话框的底部窗格显示状态的内容。
  5. 如果您已完成所有文件,请单击“恢复”。

(Source)

来源

For Android Studio / IntelliJ / AppCode:

对于 Android Studio / IntelliJ / AppCode:

  1. Go to the Project tool window and right-click the projectnode or just a folder, where the file used to exist
  2. On the context menu, choose Local History, and click Show Historyon the submenu
  3. The local history view for a project or folder shows you everything that you have done during the last few days. In the Actioncolumn of the lower part of the dialog box, select the action you want to roll back. In our case, this is the Deletingaction. So doing, the upper part of the dialog box shows the tree view of changed files.
  4. If you want to restore the deleted file only, regardless of the other changes that have been done since then, you can select the file Lost.txt in the tree view and click the Revertbutton on the upper toolbar. The file will be restored silently.
  1. 转到“项目”工具窗口并右键单击项目节点或只是一个文件夹,该文件曾经存在于该文件夹中
  2. 在上下文菜单上,选择本地历史记录,然后单击子菜单上的显示历史记录
  3. 项目或文件夹的本地历史视图显示您在过去几天内所做的一切。在对话框下方的操作栏中,选择要回滚的操作。在我们的例子中,这是删除操作。这样,对话框的上部显示了更改文件的树视图。
  4. 如果您只想恢复已删除的文件,而不管此后所做的其他更改,您可以在树视图中选择文件 Lost.txt 并单击上方工具栏上的恢复按钮。文件将以静默方式恢复。

(Source)

来源

回答by Salman Anjum

UPDATED SHORT ALTERNATIVE:

更新的简短替代方案:

Android Studio:

安卓工作室:

  1. Go to Project Window tool
  2. Expand res folder
  3. Right click on layout and Place cursor on Local History (it is perhaps the 5th or 6th last option)
  4. Select Show history
  1. 转到项目窗口工具
  2. 展开 res 文件夹
  3. 右键单击布局并将光标放在本地历史上(可能是第 5 个或第 6 个最后一个选项)
  4. 选择显示历史

here we have all the past versions available, right click a version which you want to roll back and select Revert!

这里我们有所有可用的过去版本,右键单击要回滚的版本并选择还原!

回答by Jawad Zeb

Press Ctrl+Shift+ E(Recently changed files)

Ctrl+ Shift+ E(最近更改的文件)

and restore those file via revert..

并通过还原还原这些文件..

It is under Toolbar -> View -> Recently changed files

它位于工具栏 -> 查看 -> 最近更改的文件