Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
86 views

I am a newcomer to Git and am probably missing something basic. My desired practice is to create a branch from main, work on a given release in that branch, and merge to main when release code is ...
psantucc's user avatar
1 vote
1 answer
78 views

I'm working on some projects with a number of submodules, so it's nice to be able to reset the submodules when working on the main project. One way to solve this is by adding a flag to the reset to ...
Compholio's user avatar
  • 1,062
0 votes
3 answers
194 views

On a recently cloned project, I just now made an unintentional change/commit to my local main branch. (I had intended to create and check out a new feature branch for the change, but I wasn't ...
Cade Bryant's user avatar
  • 1,125
2 votes
3 answers
117 views

My git history looks like this: A---B--------D---F \ / / \____C/__E/ Where head is now at F, and D and F are merge commits. I forget a rebase at E from D, but only realized after ...
Ras's user avatar
  • 147
-2 votes
1 answer
59 views

Let's say I have a, b, c, d commits on main. I use "git checkout -b new-branch" while on d. On new-branch I make commits e, f. I want to remove d from main, but keep it in new-branch. If i ...
Frida M. O.'s user avatar
0 votes
0 answers
42 views

I need to reset all uncommitted Git changes while working in a local Git repository. I'm using this answer to the 12 year old Unstaged changes left after git reset --hard question in a Python script ...
Geoff Alexander's user avatar
0 votes
2 answers
63 views

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 ...
Vinod's user avatar
  • 1,215
-1 votes
1 answer
118 views

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 ...
Anxheloo's user avatar
-1 votes
2 answers
78 views

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 ...
B Kazimy's user avatar
2 votes
1 answer
263 views

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 ...
Coding Monkey's user avatar
0 votes
3 answers
107 views

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 ...
bmitc's user avatar
  • 908
-1 votes
3 answers
72 views

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 ...
Hoyt Jolly's user avatar
-2 votes
1 answer
127 views

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 ...
Anton Duzenko's user avatar
-1 votes
1 answer
101 views

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 ...
Luc's user avatar
  • 1
0 votes
0 answers
69 views

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 ...
JoonT's user avatar
  • 1,266
0 votes
1 answer
85 views

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
Mixko's user avatar
  • 633
1 vote
3 answers
174 views

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 ...
André's user avatar
  • 2,068
3 votes
5 answers
8k views

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 ...
roulette01's user avatar
  • 2,502
1 vote
2 answers
13k views

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. ...
John Little's user avatar
  • 12.8k
-2 votes
2 answers
437 views

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 ...
Charles's user avatar
  • 377
-1 votes
2 answers
801 views

I want to squash all the commits till a particular commit-id in a branch. I tried using the command git reset --soft HEAD~223 The number 223 was generated as follows: I ran the command git rev-list ...
pensee's user avatar
  • 585
0 votes
0 answers
32 views

I've scanned the documentation here and I see no mention of how to reset to a branch's latest commit. I only see [<commit>] used but sure enough, you can specifiy 'origin/develop' in git reset --...
IEnjoyEatingVegetables's user avatar
0 votes
1 answer
482 views

Is there any chance of recovering files that were not committed before this command? I used this command instead of --soft.... I am working on Linux/Visual Studio code 035e859 HEAD@{23}: reset: moving ...
Corristo's user avatar
0 votes
1 answer
120 views

In order to create a clean commit history and get rid of some files I don't want for a PR, I would like to set my working directory to be at the state of my branch, say B, but make git remain on ...
Cornelius Roemer's user avatar
0 votes
1 answer
441 views

I'm currently learning git, and I have issue what exactly do these commands do? git reset --hard HEAD~1 git checkout . What's the difference between the two? They both permanently delete the last ...
Juan Fruto's user avatar
0 votes
0 answers
34 views

I merged two branches into develop on 1st June which broke the working copy of develop branch. I am trying to hard reset these two branches to the last stable branch which is from 26th January. I did ...
Nadera Sultana Tany's user avatar
0 votes
0 answers
3k views

By mistake I committed changed to my main branch and pushed the changes to the server/Github. I want to completely get rid of the commit on GitHub. The command git reset HEAD~1 undo the last commit ...
Jay's user avatar
  • 2,422
0 votes
1 answer
429 views

I was working on my project, and I made a wrong commit (the last commit) and wanted to permanently delete it from the git logs, and I did the following command: git reset --hard HEAD^ The problem is ...
user11555842's user avatar
0 votes
1 answer
510 views

I used git reset --hard command and lost all my files. Then tried to use command git fsck which got me a dangling tree with a hash value. Then entered the git show --format=raw <hash value> ...
Ankush_anonymous's user avatar
1 vote
4 answers
3k views

I want to do something very simple: update my local main to the remote one. Except it seems HEAD and origin/main are somehow pointing to an old commit. I want to fast forward HEAD and can only seem to ...
Amnon Attali's user avatar
3 votes
2 answers
109 views

I have a git workflow scenario question and have provided the "current" and "desired" branch structures, but I don't know the correct commands to get to the desired state. Current: ...
Vada Poché's user avatar
0 votes
1 answer
62 views

Initially I have master and develop branch at the same state, but I accidently make some commits directly to the master. Now I'm going to sync the master's commit to develop, but our practices is ...
Tony_Ynot's user avatar
  • 165
0 votes
1 answer
177 views

Assuming, current branch is mainline. mainline and HEAD pointer are pointing to the latest commit. git reset HEAD~1 git branch -f mainline HEAD~1 To the best of my understanding both the commands ...
Prakarsh Pathak's user avatar
1 vote
1 answer
290 views

I have accidentally deleted my commits on pythonanywhere.com and now I see very old state of my files. My Django website isn't working at all. What I did: $ git reset --hard HEAD~1 And then: $ git ...
Percival's user avatar
0 votes
1 answer
75 views

When I stage a file, "git status" then mentions that, to UNstage that file, I can do "git reset HEAD filename". But I have also seen instances in which the recommended command is &...
John Reed Avery's user avatar
0 votes
0 answers
162 views

I used git reset without any arguments and even after I committed all the changes after, the changes are still unstaged. How to revert it? I have made many changes and committed and pushed them to the ...
Guna's user avatar
  • 1
1 vote
2 answers
146 views

I am experimenting with git reset and get some results I don't understand. First lets check git log --oneline: bebf9f0 (HEAD -> main, [MyRepository]/main) Merge branch 'main' of https://github.com/[...
Frank's user avatar
  • 730
-1 votes
1 answer
585 views

Sorry for bothering everyone! Please help. I wrongly used the git rebase --hard and overwrite all local files. Then I use git reflog and git reset --hard but did not find the former version! I ...
stander Qiu's user avatar
0 votes
0 answers
41 views

AFAIK the only git command to manipulate upstream tracking branches is git fetch (and other commands that trigger a fetch), but they only really allow a "fast forward" operation against the ...
Kache's user avatar
  • 17k
-2 votes
1 answer
286 views

I just initialized .git folder to my project with git init command. It was a problem and I just wanted to make git reset --hard and try again. But reset --hard command deleted all the files that I ...
Omer Can KAPLAN's user avatar
0 votes
0 answers
636 views

Starting from commit A, I did some changes on the files. Before a mass renaming*, I did commit B. After that I wanted to redo it again so I did git reset --hard. I expected it to be exactly what I got ...
Ooker's user avatar
  • 3,404
-2 votes
1 answer
71 views

I copied a project and edited it to create a new project. I made a lot of changes. After 3 months, I tried to push to the repository. Pushed to the older repository. (All code was fine and complete.) ...
Muhammad Owais's user avatar
0 votes
1 answer
4k views

By mistake I did a git reset HEAD~ in my branch. I see all my changed files on my local. I don't want to change anything. The branch is good as is. What do I have to do?
meez's user avatar
  • 4,888
1 vote
1 answer
368 views

I'm working on a branch called Feature. I pushed an empty commit 'New' (Commit 1) to indicate the creation of my branch (this is the standard in my company). I then edited an important file and ...
Mr_Knightley's user avatar
-2 votes
1 answer
2k views

I made a commit, then changed some files in my project, then did git reset --hard HEAD. It said untracked files for all the files I had added. How do I resolve this so that those files are tracked and ...
gkeenley's user avatar
  • 7,648
0 votes
1 answer
536 views

I needed to discard a file of my last commit, so I soft reset it and now I can commit again but GitHub Desktop gives me the Pull origin option and I am wondering what to do: Commit and then push or ...
Alecheck's user avatar
1 vote
0 answers
52 views

I directly committed some changes to my GitHub repo remotely (inside the GitHub website). I then cloned this repo and did git reset --hard HEAD~3 and git push -f to go back to previous commits and ...
Pedram's user avatar
  • 11
-1 votes
2 answers
234 views

I’m trying to solve a problem where I replace my current HEAD with a specific commit by doing git reset --hard (commit), but it always ends up dirty, which I would like to remove. I need help with ...
MeepleDeMeep's user avatar
4 votes
2 answers
118 views

In git-reset, the hard mode: --hard Resets the index and working tree. Any changes to tracked files in the working tree since are discarded. Any untracked files or directories in the way of writing ...
hustnzj's user avatar
  • 883
1 vote
1 answer
400 views

I am using the following code using gitpython: g = git.cmd.Git(r'C:\Users\alex\Files\Repo\Scripts') g.reset('--hard') g.pull() but I get the following error: GitCommandError: Cmd('git') failed due to:...
chulo's user avatar
  • 73

1
2 3 4 5
11