amending a single file in a past commit in git -


I want to fix a file in the previous file. This can affect all the ascending commits.

Is there an easy way to do this? Can you give me a guideline to do this?

Many times when I work twice, I think there has been an error in my earlier error, and I committed the 'Git Reset' my last good.

For clarification. I want to change the actual commit , that is, I want to change the contents of the past. IOW I want to change history!

If you want to modify only the second to last (for example , Not long ago, especially before many branches and mergers), then I use this process:

  1. git checkout -b tmp bad-commit
  2. Fix files
  3. git commit --amend
  4. git rebase tmp master

If you have merged between, you can try ribs-i-p , but the result is different Are spun.


Comments