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'
From here I have been working on the connection branch . At the end I have done the following:
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
...I've omitted the list of changed files to keep things short. Next:
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 -
...omit the list of changed files again to keep things short. Next:
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).
And here is my mistake. As you can see, at the beginning in the purchase branch I add several files and use the ´git stash´ command if I´m not mistaken this command is used to temporarily save the changes in that branch, and I thought that when trying to delete it it would not let me. Does anyone know how to recover that deleted branch?
Looking at your steps, I see that we can find the commit where the purchases branch was. It is the 0f734b8.
I think you can checkout that commit, and then re-create the branch.