Your file only gets overwritten if you "accept theirs" when you resolve (which will be the default option when you haven't modified your file, since the default is always to preserve all changes). Instead, "accept yours" when you resolve to permanently keep your local file, "ignoring" the later revisions ("theirs").
If you use the command line, you can do the sync + edit + sync + resolve in a single step with the "p4 undo" command, which will also leave a record in the file history that the new revision undid specific earlier revisions:
C:\Perforce\test\undo>p4 have foo //stream/main/undo/foo#6 - c:\Perforce\test\undo\foo C:\Perforce\test\undo>p4 undo foo#5,6 //stream/main/undo/foo#6 - opened for integrate ... undid //stream/main/undo/foo#5,#6 C:\Perforce\test\undo>p4 submit -d "roll back to revision 4" Submitting change 201. Locking 1 files ... integrate //stream/main/undo/foo#7 Change 201 submitted. C:\Perforce\test\undo>p4 filelog foo#=7 //stream/main/undo/foo ... #7 change 201 integrate on 2020/10/28 by Samwise@Samwise-dvcs-1509687817 (text) 'roll back to revision 4' ... ... undid //stream/main/undo/foo#5,#6