Dismiss
Announcing Developer Story

You’re more than your resume. Show off what you’ve built.

Check out Developer Story →
386
votes
8answers
282k views

How to uncommit my last commit in git [duplicate]

How can I uncommit my last commit in git? I have googled it. Is it git reset --hard HEAD or git reset --hard HEAD^ Thank you.
63
votes
2answers
74k views

Is there a way to rollback my last push to Git? [duplicate]

Possible Duplicates: Undoing a 'git push' I have pushed some bad code, and I am the only user of the repository. How can I rollback my last commit?
44
votes
2answers
11k views

Move (or “Undo”) last git commit to unstaged area [duplicate]

What's the best way to move your last git commit back into the "Changes not staged" + "Untracked files" areas (with the commit in question being not-pushed / only in your local repo, effectively ...
12
votes
1answer
26k views

How to undo last commit [duplicate]

I did the following comments git add /file1/path git rm /file/path git commit -m "message" how do I undo my last commit using git? Like I don't want to have those files committed.
10
votes
2answers
12k views

Undo several commits in git which have not pushed to remote [duplicate]

I have run git status and # On branch master # Your branch is ahead of 'origin/master' by 4 commits. # (use "git push" to publish your local commits) # # Changes not staged for commit: # (use "...
7
votes
3answers
1k views

accidentally committed in git [duplicate]

Possible Duplicate: Git undo last commit I have a folder structure like this.. ~/git ......all repos of my github account .....play .....emacs.d .....dummy .....etc i ...
-2
votes
1answer
1k views

How to undo a commit on a GitHub repo? [duplicate]

My local repo is the latest one, then the GitHub repo is a little older, and then there's another repo that is the oldest, and I made some temporary changes to the oldest repo, then accidentally ...
3
votes
1answer
496 views

change a git commit already pushed [duplicate]

I accidently overwrote another developper's changes when doing a merge in git. I know how to undo the last commit, that is, my merge. My problem is that I already pushed those commits into our online ...
1
vote
3answers
454 views

After using git commit -a, how to revert it back [duplicate]

Possible Duplicate: Git undo last commit After using git commit , how can I discard this commit and revert to my original state?
0
votes
1answer
339 views

Undo last commit, but leave repository unchanged [duplicate]

I just did add and commit on my repository, did not push it yet. Now there are files in the commit that actually needed to be ignored. So I need to undo that add and commit, but all files need to stay ...
2
votes
1answer
300 views

How to undo a git push -u origin my_branch? [duplicate]

I used the following command to send my local git commit to the server: git push -u origin my_bransh How to undo this push?
-6
votes
2answers
587 views

How I undo my last commit? [duplicate]

I accidentally rest my commit in git and I would undo the last commit are their any way to undo last commit in git . I want to undo the last rest .
0
votes
3answers
159 views

How do i remove the latest commit from my repo? [duplicate]

I have made some error with my latest commit to my github repo. How can i delete tha latest one? Do i use this command: git reset --hard HEAD^ for remove the latest one? and then: git push origin ...
-1
votes
2answers
94 views

How to undo the last commit in git [duplicate]

By mistake, I did git add . and git commit in the develop branch. But luckily, I did not do git push. So I wanted to revert it back to original state. I tried git reset --soft and git reset HEAD --...
-2
votes
1answer
84 views

How to remove/revert commited changes to local git repo [duplicate]

I've committed some changes to local git repo with command git commit -m "Change X" Question: Is it possible to revert/remove this change from local git and my working directory? I know I can ...

15 30 50 per page