简体   繁体   中英

Reverting source code to Java after IntelliJ's Kotlin > Java conversion

So I wanted to try out converting our backend API source code which is written in Java and see how it looks (IIRC there is a preview before converting), but once I did it it automatically started converting all the files in the selected folders, and in the end it asked for code corrections, which I responded with no as I wanted to cancel it and now I am stuck with a broken code base with no other options than:

  • Reverting to the last git commit and reimplementing all the changes done from my side (I could have prevented it but committing before the conversion but oh well)
  • Continue using Kotlin to code in but I have code errors which I don't know how to fix

What I am asking instead is if there's anyway to convert Kotlin back to Java in IntelliJ IDEA? Thank you in advance

Intellij has a feature called Local History and it can be used to go back in time for things you did not commit to your source control system. This history is retained until you install a new version of IntelliJ IDEA or invalidate caches. Read more in the Intellij help for the feature .

Your source code constantly changes as you edit, test, or compile. Any version control system tracks the differences between the committed versions, but the local changes between commits pass unnoticed. Local History is your personal version control system that tracks changes to your source code on your computer and enables you to compare versions and roll changes back, if necessary. Local History is always at your disposal, no steps are required to enable it.

Local History is independent of external version control systems and works with the directories of your project even when they are not under any VCS control. It applies to any structural artifacts: a project, a directory or package, a file, a class, class members, tags, or selected fragment of text.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM