Questions tagged [git-reset]
Sets the current Git repo head to a specified commit and optionally resets the index and working tree to match.
git-reset
523
questions
0
votes
2
answers
39
views
Regarding the repercussions of git hard reset on remote
Resetting remote to a certain commit
We would like to reset the remote to a certain commit on a specific branch (say branch A) in our project. However there are the following concerns:
We recently ...
-1
votes
1
answer
62
views
Is there a way to reset or remove all my commits into the dev branch?
I have been working on different branches and anytime task is ready I commit and create a pull request into the dev branch. Till now everything is okej, but is there a way to reverse or remove all ...
-1
votes
2
answers
47
views
how to push an old reseted or reverted heads
I can go back and forward in my history using git checkout heads git revert heads git reset heads
And when I do git push origin main I get Everything up-to-date and no change on remote server.
how to ...
2
votes
1
answer
75
views
How to reset committed file permission changes (mode change)?
I changed the permissions of all my files and directories of my git repository and committed it to my main branch, eg.
mode change 100755 => 100644 path/to/file.sh
I wanted to reset now these ...
0
votes
3
answers
84
views
Need to recover from multiple errant `git reset` commands
I know that undoing a single git reset or git reset --hard command has been asked and answered, but I have really messed things up and am not sure how to proceed because I need to undo several ...
-1
votes
3
answers
51
views
How to remove a feature from master-dev after has been intermingled with other feature commits?
Let's say we have a git repo with a master-dev branch. When developers complete their features, each feature branch in merged into the master-dev. One day, A large feature is merged into master-dev ...
-2
votes
1
answer
109
views
Reset all files affected by past commit to the state before that commit
How do I reset all (and only) files affected by a given commit to the state before that commit?
I only need to reset the files in the commit, not the entire repository or single file/directory, and I ...
0
votes
0
answers
63
views
Can't use reset --hard on individual file?
I had a patch I wanted to apply on a fresh branch, and commit.
(I was trying to rescue myself from the problem described at
this question.)
So I did
git apply patchfile
git add file1
git add file2
git ...
-1
votes
1
answer
53
views
I want to bring back COMMITED but then deleted files on my local repository after doing git reset hard
I have staged and commited a very large folder (created and only present on my local repository) but then I did git reset hard to revert my big commit which was a mistake. However, luckily, I commited ...
0
votes
0
answers
60
views
How do I cancel a merge commit (non-squash)?
In this case, if you output git log --online, you should see something like this
c6 merge iss53 to master
c5
c3
c4
c2
c1
...
As you can see, c4,c6 are commits from the master branch, and
c5,c3 are ...
0
votes
1
answer
71
views
I accidentally git reset --hard in the first initial commit, how to restore it back?
I noticed error with the initial commit. So I ran 'git reset --hard origin/master' command. After this command it deleted all the files locally and didn't see anything, How can I restore all files
1
vote
3
answers
110
views
Wrong git commit to trunk in local, how to pull clean from remote?
After doing some changes I committed them locally to the trunk before branching. I then branched and pushed my changes to the remote repository.
Now the remote repository has the changes it needs to ...
2
votes
5
answers
2k
views
How do I check what `origin` references in my remote repository?
For as long as I used git, if I want to reset my local branch to the remote master branch, I've done
git reset --hard origin
and this seems to work empirically, but I recently learned that this might ...
1
vote
2
answers
4k
views
git "You have divergent branches" when I havent made any changes or commits
I cloned a repo, then later I want to pull the latest version.
I have made no modifications or commits locally.
However, git pull says this:
fatal: Need to specify how to reconcile divergent branches.
...
-2
votes
2
answers
312
views
How can I reset to the main branch in git
I want to make my current branch exactly the same as my main branch. When I do 'git reset --hard main', it does the job. But then when I push it complains that it is behind.
error: failed to push some ...