On branch compras
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: filtrar_busqueda/informacion_producto.php
modified: filtrar_busqueda/show_all.php
modified: funciones/funciones_busqueda.php
modified: js/script_publicar_anuncio.js
modified: login/info.php
no changes added to commit (use "git add" and/or "git commit -a")
C:\xampp\htdocs>
C:\xampp\htdocs>git add -A
C:\xampp\htdocs>git checkout master
Switched to branch 'master'
M filtrar_busqueda/informacion_producto.php
M filtrar_busqueda/show_all.php
M funciones/funciones_busqueda.php
M js/script_publicar_anuncio.js
M login/info.php
Your branch is up-to-date with 'origin/master'.
C:\xampp\htdocs>git checkout compras
Switched to branch 'compras'
M filtrar_busqueda/informacion_producto.php
M filtrar_busqueda/show_all.php
M funciones/funciones_busqueda.php
M js/script_publicar_anuncio.js
M login/info.php
C:\xampp\htdocs>git add -A
C:\xampp\htdocs>git status
On branch compras
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: filtrar_busqueda/informacion_producto.php
modified: filtrar_busqueda/show_all.php
modified: funciones/funciones_busqueda.php
modified: js/script_publicar_anuncio.js
modified: login/info.php
C:\xampp\htdocs>git stash
Saved working directory and index state WIP on compras: 0f734b8 arreglo de
cantidades en stock al hacer y rechazar un pedido
C:\xampp\htdocs>git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
C:\xampp\htdocs>git checkout -b conexion
Switched to a new branch 'conexion'
从这里我一直在连接分支上工作。最后我做了以下事情:
C:\xampp\htdocs>git add -A
C:\xampp\htdocs>git commit -m "mensaje del commit"
[conexion de5a847] mensaje del commit
106 files changed, 873 insertions(+), 2589 deletions(-)
delete mode 100644 contacto_qbc/datos_conexion.php
delete mode 100644 errores/datos_conexion.php
...我省略了更改文件的列表以保持简短。下一个:
C:\xampp\htdocs>git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
C:\xampp\htdocs>git merge conexion
Updating 0f734b8..de5a847
Fast-forward
contacto_qbc/datos_conexion.php | 7 -
datos_conexion.php | 1 -
...再次省略已更改文件的列表以保持简短。下一个:
C:\xampp\htdocs>git branch
compras
conexion
errores
errores2
errores_fac
history
* master
purchases
purchases2
qr
sales2
C:\xampp\htdocs>git checkout compras
Switched to branch 'compras'
C:\xampp\htdocs>git status
On branch compras
nothing to commit, working tree clean
C:\xampp\htdocs>git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
C:\xampp\htdocs>git branch -d compras
Deleted branch compras (was 0f734b8).
这是我的错误。如您所见,在购买分支的开头,我添加了几个文件并使用“git stash”命令,如果我没记错的话,此命令用于临时保存该分支中的更改,我认为在尝试删除它不会让我。有谁知道如何恢复已删除的分支?
查看您的步骤,我看到我们可以找到购买分支所在的提交。它是 0f734b8。
我认为您可以签出该提交,然后重新创建分支。