git-undo | A way to unfuck your git repo | Version Control System library
kandi X-RAY | git-undo Summary
kandi X-RAY | git-undo Summary
A way to unfuck your git repo
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of git-undo
git-undo Key Features
git-undo Examples and Code Snippets
Community Discussions
Trending Discussions on git-undo
QUESTION
Scenario:
- Created a Feature Branch From Master(Blue Color Branch)
- Made commits to it
- Later Merged with the Master and Deleted the Branch
- In between, I have created other Feature Branches and made commits to them.
Question: How can I get back the branch I deleted and unmerge so that the master looks clean without the Feature Branch (Blue Color)? I may need to add commits to that Feature Branch in future also.
I have looked at the following resources: Git undo local branch delete Git unmerge a branch
Do I need to do both of the above to get the desired result? Or do I want to create a new branch and revert the commits added in the Feature Branch and merge it?
I am completely confused and please redirect me to the right path. A sample Git Graph for the use-case is given below.
Note: There is no merge in between the Feature Branch (Blue).
...ANSWER
Answered 2020-May-24 at 06:54Simply undo all commits on the master branch till you get back to the merge commit (with the deleted branch).
As merging two brances is a commit too, you then can just undo that.
Note: You can also use git rebase
(more about that here) to move single commits you made to another branch if necessary
References:
- Another useful thread - removing a single commit
QUESTION
What is the best way to discard uncommitted changes with Git.
I read this, but want to fully understand what each step is doing.
...ANSWER
Answered 2019-Mar-17 at 20:19You can do (from your repo root)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install git-undo
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page