Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
368 views

Undo a pull request and stash it

I pulled my 'preprod branch' into my 'master branch' which was 8 commits ahead of master and when I pulled it, It got commited to master but haven't pushed to master yet. I want to revert the pull ...
4LPH4's user avatar
  • 328
9 votes
3 answers
12k views

Can't discard changes in git

A week or two ago I took some files that I had been archiving with a simple find |sed|tar|xz|gpg bash script, unpacked them all, and put their contents in a git repo, commited, put the next archives ...
Nero gris's user avatar
  • 582
0 votes
1 answer
1k views

Git: Is it possible to recover my local unstaged changes (which were once staged) after a git reset --hard? [duplicate]

I had some changes in my local branch which I added using git add -A. Then for some reasons I unstaged these changes by doing git reset. Then I opened GitExtensions and clicked on Reset all changes. (...
Ajinkya's user avatar
  • 1,421
1 vote
1 answer
620 views

Missing untracked files after soft reset

Originally I had commited to the wrong branch, wanted to take that back and commit to the right one (master). I wanted to go the route that is suggested in the accepted answer from How to fix ...
Sandro's user avatar
  • 463
0 votes
1 answer
902 views

GIT remove changes of specific commit from current HEAD

Assume I have recent changes added or not added to the index. Now I'm cherry-picking a specific commit without creating a new commit on my HEAD ... git cherry-pick -n <commit> How do I remove ...
codekandis's user avatar
2 votes
0 answers
769 views

Git stash and reset not working as expected

I have unstaged changes (in tracked files) that I want to delete. I try running git stash then git stash drop, and the unstaged changes are still there. I try running git add -A and then git reset --...
wheeler's user avatar
  • 3,231
7 votes
4 answers
4k views

How do I save work in progress without using git-stash?

I have a git directory with this situation: ProgSoul@PROGSOUL-LENOVO:~/esercizio3_2$ git status Sul branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) ...
Antonio Notarangelo's user avatar
5 votes
2 answers
6k views

Undo git reset --hard after git stash pop

I had some changes in the stash that I attempted to recover using git stash pop. There were some merge conflicts, and rather than resolving them, I decided to just reset it. Unfortunately, in a moment ...
eirikir's user avatar
  • 3,842
0 votes
1 answer
2k views

Is "git clean" followed by "git stash clear" redundant when creating a pristine checkout?

I would like to write a script that guarantees a successful Git checkout without intervention from the user. I don't mind dumping anything that cannot be solved without user intervention: for example, ...
lofidevops's user avatar
  • 16.8k
1 vote
2 answers
4k views

How do I rework a git merge commit?

I would like to amend a merge commit which failed a unit test on our continuous integration server, but I don't want to leave a commit which fails tests in the history. Since this commit was only ...
Mark Booth's user avatar
  • 7,894
13 votes
7 answers
16k views

Git cannot undo modified files

I just want to get back to a clean working directory, exactly as it was after my last commit. Git is reporting to me a load of file modifications that I haven't made, so I suspect it's something to do ...
WickyNilliams's user avatar
0 votes
1 answer
551 views

Git recover stashed changes after merge --no-ff

I frequently use "git stash" and "git stash pop" to save and restore changes in my working tree. This is what I did and my previous uncommitted changes now are gone. git stash -u git checkout master ...
user43092's user avatar
  • 363
3985 votes
14 answers
1.1m views

Move existing, uncommitted work to a new branch in Git

I started some work on a new feature and after coding for a bit, I decided this feature should be on its own branch. How do I move the existing uncommitted changes to a new branch and reset my ...
Dane O'Connor's user avatar