使用source tree 误删远程以及本地仓库恢复办法

今天手欠,一不小心把刚开发好的分支给删除了,连同远程分支一起干没了,慌一批。。。,感谢度娘让我找到了方法,这里记录一下

1、打开在项目根目录 git命令行窗口
2、输入 git reflog
3、找到要恢复的分支信息
4、找到最新的一次commit信息
5、 Ctrl+C 退出查看模式
6、git checkout -b hotfix_ljz_20220530_cule 69ebcbd19
在这里插入图片描述
7、再回调sourcetree 中就看到分支被恢复了
8、如果需要恢复到远程分支,则推送到远端即可

参考:http://t.zoukankan.com/boonya-p-14810113.html
参考:https://blog.youkuaiyun.com/yanghui555/article/details/122218251

ERROR: device-tree-xilinx-v2023.1+gitAUTOINC+0bd6e466ba-r0 do_compile: Error executing a python function in exec_func_python() autogenerated: The stack trace of python calls that resulted in this exception/failure was: File: 'exec_func_python() autogenerated', lineno: 2, function: <module> 0001: *** 0002:devicetree_do_compile(d) 0003: File: '/home/mlt/myboot/ethernet/PZ_ZYNQ/components/yocto/layers/poky/meta/classes-recipe/devicetree.bbclass', lineno: 137, function: devicetree_do_compile 0133: if not(os.path.isfile(dtspath)) or not(dts.endswith(".dts") or devicetree_source_is_overlay(dtspath)): 0134: continue # skip non-.dts files and non-overlay files 0135: except: 0136: continue # skip if can't determine if overlay *** 0137: devicetree_compile(dtspath, includes, d) 0138:} 0139: 0140:devicetree_do_install() { 0141: for DTB_FILE in `ls *.dtb *.dtbo`; do File: '/home/mlt/myboot/ethernet/PZ_ZYNQ/components/yocto/layers/poky/meta/classes-recipe/devicetree.bbclass', lineno: 125, function: devicetree_compile 0121: dtcargs += ["-i", i] 0122: dtcargs += ["-o", "{0}.{1}".format(dtname, "dtbo" if isoverlay else "dtb")] 0123: dtcargs += ["-I", "dts", "-O", "dtb", "{0}.pp".format(dts)] 0124: bb.note("Running {0}".format(" ".join(dtcargs))) *** 0125: subprocess.run(dtcargs, check = True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 0126: 0127:python devicetree_do_compile() { 0128: includes = expand_includes("DT_INCLUDE", d) 0129: listpath = d.getVar("DT_FILES_PATH") File: '/home/mlt/petalinux/components/yocto/buildtools/sysroots/x86_64-petalinux-linux/usr/lib/python3.10/subprocess.py', lineno: 524, function: run 0520: # We don't call process.wait() as .__exit__ does that for us. 0521: raise 0522: retcode = process.poll() 0523: if check and retcode: *** 0524: raise CalledProcessError(retcode, process.args, 0525: output=stdout, stderr=stderr) 0526: return CompletedProcess(process.args, retcode, stdout, stderr) 0527: 0528: Exception: subprocess.CalledProcessError: Command '['dtc', '-@', '-@', '-p', '0x1000', '-@', '-i', '/home/mlt/myboot/ethernet/PZ_ZYNQ/components/plnx_workspace/device-tree/device-tree', '-i', '/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work-shared/zynq-generic-7z035/kernel-source/scripts/dtc/include-prefixes', '-i', '/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/zynq_generic_7z035-xilinx-linux-gnueabi/device-tree/xilinx-v2023.1+gitAUTOINC+0bd6e466ba-r0', '-i', '/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work-shared/zynq-generic-7z035/kernel-source/arch/arm/boot/dts', '-i', '/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/zynq_generic_7z035-xilinx-linux-gnueabi/device-tree/xilinx-v2023.1+gitAUTOINC+0bd6e466ba-r0/git/device_tree/data/kernel_dtsi/2023.1/BOARD/', '-o', 'system-top.dtb', '-I', 'dts', '-O', 'dtb', 'system-top.dts.pp']' returned non-zero exit status 1. Subprocess output: Error: /home/mlt/myboot/ethernet/PZ_ZYNQ/components/plnx_workspace/device-tree/device-tree/system-conf.dtsi:14.1-16 Label or path axi_ethernet_0 not found FATAL ERROR: Syntax error parsing input tree ERROR: Logfile of failure stored in: /home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/zynq_generic_7z035-xilinx-linux-gnueabi/device-tree/xilinx-v2023.1+gitAUTOINC+0bd6e466ba-r0/temp/log.do_compile.26216 ERROR: Task (/home/mlt/myboot/ethernet/PZ_ZYNQ/components/yocto/layers/meta-xilinx/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb:do_compile) failed with exit code '1' ERROR: cracklib-2.9.8-r0 do_fetch: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; export SSL_CERT_FILE="/home/mlt/petalinux/components/yocto/buildtools/sysroots/x86_64-petalinux-linux/usr/lib/ssl-3/certs/ca-certificates.crt"; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export SSH_AGENT_PID="1938"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export GIT_SSL_CAINFO="/home/mlt/petalinux/components/yocto/buildtools/sysroots/x86_64-petalinux-linux/etc/ssl/certs/ca-certificates.crt"; export PATH="/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/home/mlt/myboot/ethernet/PZ_ZYNQ/components/yocto/layers/poky/scripts:/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/cracklib/2.9.8-r0/recipe-sysroot-native/usr/bin/arm-xilinx-linux-gnueabi:/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/cracklib/2.9.8-r0/recipe-sysroot/usr/bin/crossscripts:/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/cracklib/2.9.8-r0/recipe-sysroot-native/usr/sbin:/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/cracklib/2.9.8-r0/recipe-sysroot-native/usr/bin:/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/cracklib/2.9.8-r0/recipe-sysroot-native/sbin:/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/cracklib/2.9.8-r0/recipe-sysroot-native/bin:/home/mlt/myboot/ethernet/PZ_ZYNQ/components/yocto/layers/poky/bitbake/bin:/home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/hosttools"; export HOME="/home/mlt"; LANG=C git -c gc.autoDetach=false -c core.pager=cat fetch -f --progress https://github.com/cracklib/cracklib refs/*:refs/* failed with exit code 128, no output ERROR: cracklib-2.9.8-r0 do_fetch: Bitbake Fetcher Error: FetchError('Unable to fetch URL from any source.', 'git://github.com/cracklib/cracklib;protocol=https;branch=master') ERROR: Logfile of failure stored in: /home/mlt/myboot/ethernet/PZ_ZYNQ/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/cracklib/2.9.8-r0/temp/log.do_fetch.50736 ERROR: Task (/home/mlt/myboot/ethernet/PZ_ZYNQ/components/yocto/layers/poky/meta/recipes-extended/cracklib/cracklib_2.9.8.bb:do_fetch) failed with exit code '1'
08-19
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值