The development cycles in the software industry are shrinking due to the increasing demands for shorter time to market and the incremental development style of agile methodologies. Pragmatic software engineering approaches rely on careful product management, a strong versioning discipline, and a feature development strategy to avoid that newly merged code disrupts existing systems. Versioning is critical when managing software product lines and ensuring that all their variants are kept in operation amidst all the performed changes. Such methodologies enforce functional correctness through strong efforts in regression testing, with the associated exponential growth in complexity. In this paper, we propose a language-based approach to software versioning. Unlike the traditional approach of mainstream VCS, where each evolution step is represented by a textual diff, we treat versions as first-class citizens. Each evolution step, merge operation, and version relationship, is represented as code in the program. We extend prior work, Versioned Featherweight Java, to support a full-fledged version control system. First, we introduce multi-branching and merge operations, which allow for more advanced workflows. We also present a slicing procedure implemented in a compile-time tool that extracts well-typed Featherweight Java code for any single version out of a versioned codebase. We present formal soundness results that ensure that the sliced code for any version is well-behaved and has the same behaviour as the multi-version source code. We believe that our developments effectively model relevant domains of software evolution, such as feature-oriented programming, software product lines, and continuous delivery scenarios. By lifting the versioning aspect, usually represented by text diffs, to the language level, we pave the way for tools that interact with software repositories (e.g. CI/CD, GitHub Actions) to have more insight regarding the evolution of the software semantics.