- State1: A file has a value 'A'
- State2: value changed to 'B'
- State3: Git add(put in index/staging area)
- State4: File committed(put in repository)
I want to do a revert to get to State3(put in staging area) or just state2. Effectively deleting the commit. How can I do it? I cannot find anything that does this.
These are my findings. Are they correct?
- Checkout: revert to State1
- Reset: revert to State1
- Revert: revert to State1
Edit: State3 is optional as State4 does that for you. It is not "put in index" but "edit in index"