A
A
Alexander2017-04-13 16:06:24
git
Alexander, 2017-04-13 16:06:24

How to undo a commit but keep all changes?

It is necessary to return so that all the current changes would be visible to me in the GIT GUI, that is, before I pressed Commit. Just make one more edit and then I want to press Commit. Often this is needed.
In other words, the changes in the files, even if they are such, do not need to return to the state of the previous commit. But whatever GIT thinks it's already a commit. Something like this...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Sergey, 2017-04-13
@sanok_ps

this will undo the last commit but leave the changes
and this will update the current commit with the updated data.
it is very important NOT to do these manipulations if the commit to be undone has already been uploaded to the server and downloaded by colleagues.

A
anton_lazarev, 2017-04-13
@anton_lazarev

If I understand the question correctly, then you need git commit --amend
more details: https://habrahabr.ru/company/mailru/blog/267595/#8

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question