0

I have Git commit "Day 19" that doesn't have all the code I wanted to commit. Then I made a new commit with those new changes "Day 21". Is there a way to re-commit things from "today" to "yesterday"? For example, if I would make a new branch at commit "Day 18" (commit before "Day 19") and merge the branch with newer commits can I somehow keep the code without committing it immediately?

This is what am talking about: enter image description here

I don't know how to use Git very well, so maybe this solution is impossible I'm just trying to explain my problem with it.

Thanks in advance!

0sergej
  • 31
  • 3
  • 2
    It's really not clear what you are trying to describe. Git allows you to undo or redo or refactor anything you have not yet pushed, and probably yours is a duplicate of an existing question, but I can't tell if you are trying to break up a commit into two or combine two commits into one, or something else entirely. – tripleee May 13 '22 at 19:44
  • Maybe using interactive rebase could help? https://support.gitkraken.com/working-with-repositories/interactive-rebase/ https://www.youtube.com/watch?v=JkpYvXdbnfQ – rmjoia May 16 '22 at 08:05
  • https://stackoverflow.com/questions/12481639/remove-files-from-git-commit This is a solution to my problem. I overcomplicated it... – 0sergej May 18 '22 at 16:28

0 Answers0