Skip to content

Edit a commit and bring all the changes back to unstaged #4461

Answered by stefanhaller
ruudk asked this question in Q&A
Discussion options

You must be logged in to vote

How would you deal with the following: you have 3 commits A, B, C. You realize that there are code formatting issues introduced in A. I want to go back to A, and run my code formatter, and then recommit that as A.

Select A, hit e. Run your formatter; hit shift-A to amend, and continue the rebase. You are likely to get conflicts in B and/or C; resolve them using "incoming" for all. (Now this last thing is something that's not very convenient in lazygit yet, we might improve this at some point).

Or, you realize that you want to introduce a commit between A, and B, C. I know I can commit it as D, and then move it down twice. But sometimes, it's easier to "go back in time", forget about wh…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ruudk
Comment options

@stefanhaller
Comment options

Answer selected by ruudk
@ruudk
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants