如何撤消删除github Wiki页面? [英] How do I undo deleting a github wiki page?

查看:188
本文介绍了如何撤消删除github Wiki页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我删除了github存储库Wiki上的页面.

I deleted a page on a github repo's wiki.

现在单击文件的链接即可将我带到新的编辑屏幕.我以为这可能是在回购的分支中,但是在chrome上以隐身模式链接后,出现以下错误:我没有编辑此文件的权限(大概是因为我正在尝试创建该文件,但未登录)在隐身模式下).

Clicking on the link to the file now brings me to a new edit screen. I thought this might be in my fork of the repo, but following the link in incognito mode on chrome gives me the error that I do not have permission to edit this file (presumably because I am trying to create it and I am not logged in in incognito).

我知道您可以还原文件中的更改,但是如何还原删除github存储库Wiki上的文件?

I know you can revert changes in files, but how do I revert deleting a file on a github repo's wiki?

推荐答案

您可以克隆项目的维基宝库 ,并在本地还原该页面.

You can clone the wiki repo of your project, and restore that page locally.

git clone https://myusername@github.com/myusername/foobar.wiki.git
git checkout $(git rev-list -n 1 HEAD -- yourPage)^ -- yourPage

然后,您返回到GitHub上的Wiki存储库:这应该允许它再次显示您的页面.

Then you push back to the wiki repo on GitHub: that should allow it to display your page again.

这篇关于如何撤消删除github Wiki页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆